I use CMake to build my project. I added a binary unit test using the Boost unit testing framework. This binary contains all unit tests. I added this binary to run CTest:
ADD_EXECUTABLE( tftest test-main.cpp ) ENABLE_TESTING() ADD_TEST( UnitTests tftest)
But the build output in Visual Studio shows only the result of running CTest:
Start 1: UnitTests 1/1 Test
This is not very useful because I cannot see which test failed. If I run ctest manually from the command line with --verbose , I get output from the Boost unit test, which reports that it actually failed:
1: Test command: tftest.exe 1: Test timeout computed to be: 9.99988e+006 1: Running 4 test cases... 1: test-main.cpp(20): error in "sanity_check3": check 1 == 2 failed 1: 1: *** 1 failure detected in test suite "Master Test Suite" 1/1 Test
So what do I need to change in CMakeLists.txt so that CTest always starts with --verbose ? Is there a better way to use Boost unit tests with CMake / CTest?
cmake ctest
Skrymsli Apr 18 '11 at 23:15 2011-04-18 23:15
source share