Skapa CTest-baserade tester
CTest kan köra tester för CMake-baserade projekt oavsett testramverk. Du konfigurerar testerna i projektfilen, vanligtvis CMakeLists.txt. I princip aktiverar du testning för projektet och registrerar testapplikationerna eller till och med specialkommandon.
enable_testing() add_test(NAME test_example COMMAND test_example)
Lägg till test_example som ett körbart program innan du försöker registrera det som test. Det kan vara vilket körbart kommando som helst, inklusive argument.
För mer information om hur du använder CTest, se Testa med CTest.
Se även Så här gör du: Testa, Välj byggsystem och 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.