Opret CTest-baserede tests

CTest kan udføre test for CMake-baserede projekter uanset testrammen. Du konfigurerer testene i projektfilen, som regel CMakeLists.txt. Grundlæggende aktiverer du testning for projektet og registrerer testapplikationerne eller endda specielle kommandoer.

enable_testing()
add_test(NAME test_example COMMAND test_example)

Tilføj test_example som en eksekverbar fil, før du forsøger at registrere den som test. Det kan være en hvilken som helst eksekverbar kommando, inklusive argumenter.

For mere information om, hvordan du bruger CTest, se Test med CTest.

Se også Sådan gør du: Test, Vælg build-system og Testning.

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.