diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CTestMemcheck/RunCMakeTest.cmake | 16 | ||||
-rw-r--r-- | Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake | 18 | ||||
-rw-r--r-- | Tests/RunCMake/README.rst | 10 | ||||
-rw-r--r-- | Tests/RunCMake/RunCTest.cmake | 17 |
4 files changed, 30 insertions, 31 deletions
diff --git a/Tests/RunCMake/CTestMemcheck/RunCMakeTest.cmake b/Tests/RunCMake/CTestMemcheck/RunCMakeTest.cmake index 005745e..b1793fa 100644 --- a/Tests/RunCMake/CTestMemcheck/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestMemcheck/RunCMakeTest.cmake @@ -1,23 +1,11 @@ -include(RunCMake) +include(RunCTest) set(SITE test-site) set(BUILDNAME test-build) set(COVERAGE_COMMAND "") function(run_mc_test CASE_NAME CHECKER_COMMAND) - configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in - ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY) - configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in - ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY) - configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in - ${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY) - run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND} - -C Debug - -S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake - -V - --output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log - ${ARGN} - ) + run_ctest(${CASE_NAME} ${ARGN}) endfunction() unset(CTEST_EXTRA_CONFIG) diff --git a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake index 797365d..c004e97 100644 --- a/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestSubmit/RunCMakeTest.cmake @@ -1,26 +1,10 @@ -include(RunCMake) +include(RunCTest) # Default case parameters. set(CASE_DROP_METHOD "http") set(CASE_DROP_SITE "-no-site-") set(CASE_CTEST_SUBMIT_ARGS "") -function(run_ctest CASE_NAME) - configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in - ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY) - configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in - ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY) - configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in - ${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY) - run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND} - -C Debug - -S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake - -V - --output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log - ${ARGN} - ) -endfunction() - #----------------------------------------------------------------------------- # Test bad argument combinations. diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst index e801a86..4aae4ae 100644 --- a/Tests/RunCMake/README.rst +++ b/Tests/RunCMake/README.rst @@ -22,6 +22,16 @@ but do not actually build anything. To add a test: to fully customize the test case command-line. + Alternatively, if the test is to cover running ``ctest -S`` then use:: + + include(RunCTest) + run_ctest(SubTest1) + ... + run_ctest(SubTestN) + + and create ``test.cmake.in``, ``CTestConfig.cmake.in``, and + ``CMakeLists.txt.in`` files to be configured for each case. + 4. Create file ``<Test>/CMakeLists.txt`` in the directory containing:: cmake_minimum_required(...) diff --git a/Tests/RunCMake/RunCTest.cmake b/Tests/RunCMake/RunCTest.cmake new file mode 100644 index 0000000..e94432b --- /dev/null +++ b/Tests/RunCMake/RunCTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +function(run_ctest CASE_NAME) + configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in + ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY) + configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in + ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY) + configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in + ${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY) + run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND} + -C Debug + -S ${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake + -V + --output-log ${RunCMake_BINARY_DIR}/${CASE_NAME}-build/testOutput.log + ${ARGN} + ) +endfunction() |