Browse Source

CTest: fix pre and post test commands with spaces

If the pre or post memcheck or test commands have spaces in the path these
were never escaped, leading to broken commands. This was not covered in the
test suite so it went unnoticed.
Rolf Eike Beer 13 years ago
parent
commit
6187876dea
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Source/CTest/cmCTestTestHandler.cxx

+ 3 - 2
Source/CTest/cmCTestTestHandler.cxx

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