[cmake-developers] Failing dashboard tests calling a sub-ctest

Brad King brad.king at kitware.com
Thu May 9 09:33:36 EDT 2013


On 05/09/2013 09:10 AM, Rolf Eike Beer wrote:
> A bunch of tests on the dashboard currently fail because the sub-ctest they 
> start doesn't know about it's configuration. I can go the easy road and just 
> force that to Debug, but that doesn't seem right. Does anybody have an idea 
> how to properly fix this?

The -C \${CTEST_CONFIGURATION_TYPE} trick is useful only in the
old-style add_test signature.  The modern add_test(NAME) signature
will escape the literal "${CTEST_CONFIGURATION_TYPE}" argument but
instead you can use the $<CONFIGURATION> generator expression:

diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt
index e9d1f43..b0ca65e 100644
--- a/Tests/CTestTestMemcheck/CMakeLists.txt
+++ b/Tests/CTestTestMemcheck/CMakeLists.txt
@@ -49,7 +49,7 @@ function(gen_mc_test_internal NAME CHECKER)
     endforeach()
     add_test(NAME CTestTestMemcheck${NAME}
         COMMAND ${CMAKE_CTEST_COMMAND}
-        -C \${CTEST_CONFIGURATION_TYPE}
+        -C $<CONFIGURATION>
         -S "${CMAKE_CURRENT_BINARY_DIR}/${NAME}/test.cmake" -V
         --output-log "${CMAKE_CURRENT_BINARY_DIR}/${NAME}/testOutput.log"
         ${ARGN}

-Brad



More information about the cmake-developers mailing list