[CMake] [CTest] Why does --force-new-ctest-process prevent test-output?

wedekind wedekind at caesar.de
Wed Jun 13 09:02:58 EDT 2007


Hello CMake-gurus,

I have defined a test-target in my CMakeLists.txt file like this:

   add_test(${TEST_TARGET} ${CMAKE_CTEST_COMMAND}
         --extra-verbose
         --build-config       ${CMAKE_BUILD_TYPE}
         --build-and-test     ${TESTS_SOURCE_DIR} ${TESTS_BINARY_DIR}
         --build-project      ${TEST_PROJECT}
         --build-target       ${TEST_TARGET}
         --build-generator    ${_bt_generator}
         --build-makeprogram  ${_bt_makeprogram}
         --build-exe-dir      ${_exe_dir}
         --build-options      -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
         --test-command       ${TEST_TARGET}
   )

And I'm running ctest as a POST_BUILD custom-command. This works very well,
the test build-files are created and the test is built and run.

But there is a difference in running the tests:
1) via "ctest" as in my post-build command or
2) via "make test".

In the first case, the test-output is displayed correctly (which I need,
e.g. to have the line displayed where an assertion in the test has failed).
In the second case, the test-output is not displayed.

I've played around a little to find out, that "make test" calls "ctest
--force-new-ctest-process". If I ommit this parameter, "make test" also
displays the test-output correctly.

Why does --force-new-ctest-process prevents the test-output from beeing
displayed?

Why ist his parameter a default in the global generator?

Cheers!

Marco




More information about the CMake mailing list