summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2009-12-04 17:09:01 (GMT)
committerDavid Cole <david.cole@kitware.com>2009-12-04 17:09:01 (GMT)
commit0b38bb4c535ae972d7f973e3e69945a6d0c14d75 (patch)
treeac80395b194b2a8ed2bcf6b1f997b62c21d151be /Tests/CMakeLists.txt
parentaf14f1f2c3750ba3cf9b9cc1a809a88b1878a5c3 (diff)
downloadCMake-0b38bb4c535ae972d7f973e3e69945a6d0c14d75.zip
CMake-0b38bb4c535ae972d7f973e3e69945a6d0c14d75.tar.gz
CMake-0b38bb4c535ae972d7f973e3e69945a6d0c14d75.tar.bz2
Fix issue #2336 - honor the -C arg to ctest. Honor it for all stages of running -D dashboards from the command line and running ctest_configure, ctest_build and ctest_test commands in -S scripts. Also, allow a script to change it by setting the CTEST_CONFIGURATION_TYPE variable: allows for multiple configuration build/test cycles within one script. Add a new signature for the cmake command build_command that accepts CONFIGURATION as one argument. The original build_command signature is still there, but now marked as deprecated in the documentation. Of course... also add CTestConfig tests to verify that -C is honored for -D dashboards and -S scripts.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt52
1 files changed, 48 insertions, 4 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index a9b584b..fe8caeb 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1181,7 +1181,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
)
SET_TESTS_PROPERTIES(CTestTestNoBuild PROPERTIES
FAIL_REGULAR_EXPRESSION "Error" WILL_FAIL true)
-
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoExe.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake"
@@ -1194,6 +1194,50 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
PASS_REGULAR_EXPRESSION "Could not find executable"
FAIL_REGULAR_EXPRESSION "SegFault")
+
+ # Use macro, not function so that build can still be driven by CMake 2.4.
+ # After 2.6 is required, this could be a function without the extra 'set'
+ # calls.
+ #
+ macro(add_config_tests cfg)
+ set(cfg "${cfg}")
+ set(base "${CMake_BINARY_DIR}/Tests/CTestConfig")
+
+ # Test -S script with a -C config arg to ctest:
+ configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CTestConfig/script.cmake.in"
+ "${base}/${cfg}-script.cmake"
+ @ONLY ESCAPE_QUOTES)
+ add_test(CTestConfig.Script.${cfg} ${CMAKE_CTEST_COMMAND}
+ -C ${cfg}
+ -S "${base}/${cfg}-script.cmake" -VV
+ --output-log "${base}/${cfg}-script.log"
+ )
+
+ # Test -D dashboard with a -C config arg to ctest.
+ # (Actual commands inside a cmake -P script because we need to be able to set
+ # the working directory reliably...)
+ configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CTestConfig/dashboard.cmake.in"
+ "${base}/${cfg}-dashboard.cmake"
+ @ONLY ESCAPE_QUOTES)
+ add_test(CTestConfig.Dashboard.${cfg} ${CMAKE_CMAKE_COMMAND}
+ -P "${base}/${cfg}-dashboard.cmake" -VV
+ )
+ endmacro()
+
+ add_config_tests(Debug)
+ add_config_tests(MinSizeRel)
+ add_config_tests(Release)
+ add_config_tests(RelWithDebInfo)
+
+ add_test(CMakeCommands.build_command ${CMAKE_CMAKE_COMMAND}
+ -DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}
+ -Ddir=${CMake_BINARY_DIR}/Tests/CMakeCommands/build_command
+ -Dgen=${CMAKE_TEST_GENERATOR}
+ -P "${CMake_SOURCE_DIR}/Tests/CMakeCommands/build_command/RunCMake.cmake"
+ )
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake"
@@ -1256,11 +1300,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel
-S "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" -V
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/testOutput.log"
)
-
+
ADD_TEST(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N)
-
+
ADD_TEST(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B)
-
+
# Use macro, not function so that build can still be driven by CMake 2.4.
# After 2.6 is required, this could be a function without the extra 'set'
# calls.