Tworzenie testów Google
Aby utworzyć test Google:
- Przejdź do File > New Project > Test Project.
- Wybierz opcję „ Google Test Project ” > „ Choose ”, aby utworzyć projekt zawierający kod szablonowy dla testu Google.
- W oknie dialogowym „ Project and Test Information ” określ ustawienia projektu i testu:

- W oknie „ Test framework ” wybierz opcję „ Google Test (shared libraries) ”, aby połączyć projekt z biblioteką Google Test, lub „ Google Test (headers only) ”, aby dołączyć do projektu niezbędne pliki źródłowe Google Test.
- W oknie „ Test suite name ” wprowadź nazwę zestawu testów.
- W oknie „ Test case name ” wprowadź nazwę przypadku testowego.
- W przypadku testu biblioteki współdzielonej można ustawić ścieżkę do instalacji frameworka testowego Google C++ w sekcji „ Googletest install directory (optional) ”.
- W przypadku testu opartego wyłącznie na plikach nagłówkowych w polu „ Googletest source directory (optional) ” można ustawić ścieżkę do klonu repozytorium googletest.
- W sekcji „ Build system ” wybierz system kompilacji, który ma być używany do kompilacji projektu: CMake, qmake lub Qbs.
Qt Creator tworzy test w określonym katalogu projektu.
Więcej informacji na temat tworzenia testów Google można znaleźć w przewodniku Google Test Primer.
Uwaga: Podczas skanowania w poszukiwaniu testów parser uwzględnia wyłącznie pliki, które bezpośrednio lub pośrednio zawierają plik gtest/gtest.h. Pliki, które obecnie nie będą kompilowane, zostaną pominięte.
Zobacz także : Jak to zrobić: Testowanie, Wybór systemu kompilacji oraz Testowanie.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.