summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx5
-rw-r--r--Tests/CTestTestMemcheck/CMakeLists.txt6
2 files changed, 7 insertions, 4 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 0508448..7a3edb5 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1302,10 +1302,9 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
for ( it = vec.begin(); it != vec.end(); ++it )
{
int retVal = 0;
- std::string cmd = cmSystemTools::ConvertToOutputPath(it->c_str());
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << cmd
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
<< std::endl);
- if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0,
+ if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0,
cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 )
{
diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt
index ff02883..2db9282 100644
--- a/Tests/CTestTestMemcheck/CMakeLists.txt
+++ b/Tests/CTestTestMemcheck/CMakeLists.txt
@@ -91,7 +91,11 @@ gen_mcnl_test(DummyPurifyNoLogfile "\${PSEUDO_PURIFY}")
gen_mcnl_test(DummyValgrindNoLogfile "\${PSEUDO_VALGRIND}")
gen_mcnl_test(DummyBCNoLogfile "\${PSEUDO_BC}")
-set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_PRE_MEMCHECK \"\${CTEST_MEMORYCHECK_COMMAND}\")\nset(CTEST_CUSTOM_POST_MEMCHECK \"\${CTEST_MEMORYCHECK_COMMAND}\")")
+set(CTEST_EXTRA_CODE "string(REPLACE \" \" \"\\\\ \" PRE_POST_COMMAND \"\${CTEST_MEMORYCHECK_COMMAND}\")
+
+set(CTEST_CUSTOM_PRE_MEMCHECK \"\${PRE_POST_COMMAND} pre command\")
+set(CTEST_CUSTOM_POST_MEMCHECK \"\${PRE_POST_COMMAND} post command \")
+")
gen_mc_test(DummyValgrindPrePost "\${PSEUDO_VALGRIND}")
set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_POST_MEMCHECK \"\${ERROR_COMMAND}\")")