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.
This commit is contained in:
Rolf Eike Beer 2012-09-30 22:58:56 +02:00
parent 95bc8aa6c4
commit 6187876dea
1 changed files with 3 additions and 2 deletions

View File

@ -1304,9 +1304,10 @@ 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;
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); << std::endl);
if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0, if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0,
cmSystemTools::OUTPUT_MERGE cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 ) /*this->Verbose*/) || retVal != 0 )
{ {