Tworzenie testów opartych na CTest

CTest może wykonywać testy dla projektów opartych na CMake, niezależnie od używanego frameworka testowego. Testy konfiguruje się w pliku projektu, zazwyczaj w pliku CMakeLists.txt. Zasadniczo należy włączyć testowanie dla projektu i zarejestrować aplikacje testowe lub nawet specjalne polecenia.

enable_testing()
add_test(NAME test_example COMMAND test_example)

Przed próbą zarejestrowania go jako test należy dodać plik „ test_example ” jako plik wykonywalny. Może to być dowolne polecenie wykonywalne, w tym z argumentami.

Więcej informacji na temat korzystania z CTest można znaleźć w sekcji Testowanie za pomocą CTest.

Zobacz także : Jak: Testować, 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.