From f4994223bb84bfe98e0113a8a5ccac67435c13d3 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Mon, 6 May 2013 14:39:05 +0200 Subject: [PATCH] CTest: remove unreachable code and CTestTestMemcheckUnknown test The memory checker command can't be quoted at this point, because previously it has been tested that the given file exists, which will fail if the name is quoted. The CTestTestMemcheckUnknown test aimed to test this case, has always failed to do so and serves no useful purpose therefore. --- Source/CTest/cmCTestMemCheckHandler.cxx | 7 ------- Tests/CTestTestMemcheck/CMakeLists.txt | 8 +++----- .../UnknownQuoted/CMakeLists.txt | 5 ----- .../UnknownQuoted/CTestConfig.cmake | 7 ------- .../UnknownQuoted/test.cmake.in | 19 ------------------- 5 files changed, 3 insertions(+), 43 deletions(-) delete mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt delete mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake delete mode 100644 Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index b32060576..280faa0a5 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -461,13 +461,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() return false; } - if ( this->MemoryTester[0] == '\"' && - this->MemoryTester[this->MemoryTester.size()-1] == '\"' ) - { - this->MemoryTester - = this->MemoryTester.substr(1, this->MemoryTester.size()-2); - } - // Setup the options std::string memoryTesterOptions; if ( this->CTest->GetCTestConfiguration( diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt index b05d96b0b..d2f3a8745 100644 --- a/Tests/CTestTestMemcheck/CMakeLists.txt +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -31,7 +31,7 @@ target_link_libraries(memcheck_fail CMakeLib) set(NORMAL_CTEST_OUTPUT "\n1/1 MemCheck #1: RunCMake \\.+ Passed +[0-9]+.[0-9]+ sec\n\n100% tests passed, 0 tests failed out of 1\n.*\n-- Processing memory checking output: \nMemory checking results:\n") set(BULLSEYE_MSG "(BullseyeCoverage[^\n]*\n)?") -foreach (_test IN ITEMS Unknown UnknownQuoted NotExist +foreach (_test IN ITEMS Unknown NotExist DummyValgrind DummyValgrindPrePost DummyValgrindFailPre DummyValgrindFailPost DummyPurify DummyBC @@ -56,10 +56,8 @@ string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") string(REPLACE ")" "\\)" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") -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(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") 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 deleted file mode 100644 index 6f49c6144..000000000 --- a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index f0233a7a4..000000000 --- a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 1b1f7023a..000000000 --- a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in +++ /dev/null @@ -1,19 +0,0 @@ -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_CMAKE_GENERATOR_TOOLSET "@CMAKE_TEST_GENERATOR_TOOLSET@") -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)