[Cmake-commits] [cmake-commits] david.cole committed CMakeLists.txt 1.160 1.161

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Dec 4 12:08:59 EST 2009


Update of /cvsroot/CMake/CMake/Tests
In directory public:/mounts/ram/cvs-serv26529/Tests

Modified Files:
	CMakeLists.txt 
Log Message:
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.


Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/CMakeLists.txt,v
retrieving revision 1.160
retrieving revision 1.161
diff -C 2 -d -r1.160 -r1.161
*** CMakeLists.txt	1 Dec 2009 14:12:04 -0000	1.160
--- CMakeLists.txt	4 Dec 2009 17:08:57 -0000	1.161
***************
*** 1182,1186 ****
    SET_TESTS_PROPERTIES(CTestTestNoBuild PROPERTIES
      FAIL_REGULAR_EXPRESSION "Error" WILL_FAIL true)
!   
    CONFIGURE_FILE(
      "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoExe.cmake.in"
--- 1182,1186 ----
    SET_TESTS_PROPERTIES(CTestTestNoBuild PROPERTIES
      FAIL_REGULAR_EXPRESSION "Error" WILL_FAIL true)
! 
    CONFIGURE_FILE(
      "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoExe.cmake.in"
***************
*** 1195,1198 ****
--- 1195,1242 ----
      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"
***************
*** 1257,1265 ****
      --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'
--- 1301,1309 ----
      --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'



More information about the Cmake-commits mailing list