From 995a35fe12e9582c4488a7bc2deb66b0e4d25315 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Tue, 2 Oct 2012 21:56:48 +0200 Subject: [PATCH] CTest: add a check with a quoted memory checker --- Tests/CTestTestMemcheck/CMakeLists.txt | 13 +++++++++---- .../UnknownQuoted/CMakeLists.txt | 5 +++++ .../UnknownQuoted/CTestConfig.cmake | 7 +++++++ .../UnknownQuoted/test.cmake.in | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt create mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake create mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index b4a5f15a1..2730a6140 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -22,8 +22,10 @@ set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC) # binary to be used as pre- and post-memcheck command that fails add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.c") -foreach (_test IN ITEMS Unknown NotExist DummyValgrind DummyValgrindPrePost - DummyValgrindFailPre DummyValgrindFailPost DummyPurify DummyBC +foreach (_test IN ITEMS Unknown UnknownQuoted NotExist + DummyValgrind DummyValgrindPrePost + DummyValgrindFailPre DummyValgrindFailPost + DummyPurify DummyBC DummyValgrindIgnoreMemcheck) configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/${_test}/test.cmake.in" @@ -44,8 +46,11 @@ string(REPLACE "\\" "\\\\" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND}") string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") string(REPLACE ")" "\\)" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") -set_tests_properties(CTestTestMemcheckUnknown PROPERTIES - PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/Unknown/test.cmake\n") + +foreach (_unkn Unknown UnknownQuoted) + set_tests_properties(CTestTestMemcheck${_unkn} PROPERTIES + PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n") +endforeach () set_tests_properties(CTestTestMemcheckNotExist PROPERTIES PASS_REGULAR_EXPRESSION "Memory checker \\(MemoryCheckCommand\\) not set, or cannot find the specified program.") diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt new file mode 100644 index 000000000..6f49c6144 --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckUnknownQuoted) +include(CTest) + +add_test (RunCMake "\"${CMAKE_COMMAND}\"") diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake new file mode 100644 index 000000000..f0233a7a4 --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknownQuoted") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in new file mode 100644 index 000000000..e2bfb601a --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknownQuoted") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/UnknownQuoted") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/UnknownQuoted") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@") + +CTEST_START(Experimental) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)