Creare test basati su CTest

CTest è in grado di eseguire test per progetti basati su CMake indipendentemente dal framework di test utilizzato. La configurazione dei test avviene nel file di progetto, solitamente CMakeLists.txt. In sostanza, è necessario abilitare l'esecuzione dei test per il progetto e registrare le applicazioni di test o anche comandi speciali.

enable_testing()
add_test(NAME test_example COMMAND test_example)

Aggiungere test_example come eseguibile prima di provare a registrarlo come test. Può trattarsi di qualsiasi comando eseguibile, inclusi gli argomenti.

Per ulteriori informazioni su come utilizzare CTest, consultare Test con CTest.

Vedi anche Come: Eseguire un test, Selezionare il sistema di compilazione e Test.

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.