[CMake] Can't run units test defined in subdirectories
Tron Thomas
tron.thomas at verizon.net
Fri Nov 28 11:30:58 EST 2008
When I run ctest using the -VV option I get this output like this:
UpdateCTestConfiguration from
:/Users/tron/Projects/TBD/build/DartConfiguration.tcl
Start processing tests
UpdateCTestConfiguration from
:/Projects/MyProject/build/DartConfiguration.tcl
Test project /Projects/MyProject/build
Constructing a list of tests
Done constructing a list of tests
Changing directory into /Projects/MyProject/TestLibrary
1/ 1 Testing TestLibrary
Test command: /Projects/MyProject/build/Debug/TestLibrary
Test timeout computed to be: 9.99988e+06
Running 30 tests
In AngularUnitsTests::testDegreesToRadians:
/Projects/MyProject/TestLibrary/Tests/AngularUnitsTests.h:13: Error:
Test failed: Intential failure
/Projects/MyProject/TestLibrary/Tests/AngularUnitsTests.h:40: Error:
Test failed: Intential failure
.............................
Failed 1 of 30 tests
Success rate: 96%
-- Process completed
***Failed
0% tests passed, 1 tests failed out of 1
The following tests FAILED:
1 - TestLibrary (Failed)
Errors while running CTest
I had intentionally added a failure into my test application to make
sure the test process would report errors when the tests fail. This
output make it much more clear what happened when the test was run, that
the original output. How can I configure the project so output like
this will occur rather than the default output?
Bill Hoffman wrote:
> Tron Thomas wrote:
>> Okay, I changed the add_test command to:
>> add_test(${Name} ${EXECUTABLE_OUTPUT_PATH}/${Name})
>>
>> Now, when I try to build the RUN_TESTS target I get results like this:
>>
>> Start processing tests
>> Test project /Projects/MyProject/build
>> 1/ 1 Testing TestLibrary ***Failed
>>
>> 0% tests passed, 1 tests failed out of 1
>>
>> The following tests FAILED:
>> 1 - TestLibrary (Failed)
>> Errors while running CTest
>> make: *** [RUN_TESTS_buildpart_0] Error 8
>>
>> It is unclear why an error like this is occurring. The test
>> application runs successfully when launched manually.
>> How can I fix this problem so the test runs properly?
> Run this in your build tree:
>
> ctest -VV
>
> That should give you more output.
>
> -Bill
More information about the CMake
mailing list