CMake comes with a testing tool called CTest.
The idea of CTtest is that you specify a executable to run, CTest launches the executable, and the test passes if the return code is 0.
Assuming you have added some tests in your project, you can test them by running:
$ qibuild test foo
Note that for this to work you nedd to have called enable_testing() and add_test (or qi_create_test, or qi_create_gtest) somewhere in your CMakeLists.txt
qibuild test does NOT use ctest executable.
Instead, qibuild contains a ctest implementation in pure Python.
This means qibuild tests parses CMake generated code to know how to run the tests, so not all features of set_test_properties are handled ...
Also, qibuild test is optimized to be used with Jenkins, not with upstream’s CDash.
<testsuite name="test">
<testcase name="test_foo" status="run">
<failure message="Return code: 2">
<![CDATA[
ERROR: ...
]]>
</failure>
</testcase>
</testsuite>
<testsuite name="test">
<testcase name="test_foo" status="run">
<failure message="Timed out (2 s)">
</failure>
</testcase>
</testsuite>