Revert "CTest: fix pre and post test commands with spaces" (#13887)

This reverts commit 6187876dea.

It was actually possible before to have paths with spaces in them, the spaces
just need to be quoted. This way spaces will work as argument separators.
This commit is contained in:
Rolf Eike Beer 2013-07-27 21:40:25 +02:00
parent 46558d290b
commit c0756b6dd6
2 changed files with 7 additions and 4 deletions

View File

@ -1302,10 +1302,9 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
for ( it = vec.begin(); it != vec.end(); ++it ) for ( it = vec.begin(); it != vec.end(); ++it )
{ {
int retVal = 0; int retVal = 0;
std::string cmd = cmSystemTools::ConvertToOutputPath(it->c_str()); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << cmd
<< std::endl); << std::endl);
if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0, if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0,
cmSystemTools::OUTPUT_MERGE cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 ) /*this->Verbose*/) || retVal != 0 )
{ {

View File

@ -91,7 +91,11 @@ gen_mcnl_test(DummyPurifyNoLogfile "\${PSEUDO_PURIFY}")
gen_mcnl_test(DummyValgrindNoLogfile "\${PSEUDO_VALGRIND}") gen_mcnl_test(DummyValgrindNoLogfile "\${PSEUDO_VALGRIND}")
gen_mcnl_test(DummyBCNoLogfile "\${PSEUDO_BC}") 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}") gen_mc_test(DummyValgrindPrePost "\${PSEUDO_VALGRIND}")
set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_POST_MEMCHECK \"\${ERROR_COMMAND}\")") set(CTEST_EXTRA_CODE "set(CTEST_CUSTOM_POST_MEMCHECK \"\${ERROR_COMMAND}\")")