summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestRunTest.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-08-18 14:14:09 (GMT)
committerBrad King <brad.king@kitware.com>2010-08-18 14:14:09 (GMT)
commit5383657357b35481b5ff676736e36927339bea1c (patch)
treef38bfb5458c47bd9b096137910c3969f455db7a5 /Source/CTest/cmCTestRunTest.cxx
parenta3d796b9065374ea246b4ffeacc92b7c76120c9b (diff)
downloadCMake-5383657357b35481b5ff676736e36927339bea1c.zip
CMake-5383657357b35481b5ff676736e36927339bea1c.tar.gz
CMake-5383657357b35481b5ff676736e36927339bea1c.tar.bz2
CTest: Avoid use of old EscapeSpaces method
Refactor how cmCTestMemCheckHandler computes the memory tester command line options to avoid encoding them in a single string just to parse them again. The EscapeSpaces uses backslahes to escape spaces on UNIX platforms, so replace other calls to it in CTest that are used to create human-readable strings with simple double-quoting.
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r--Source/CTest/cmCTestRunTest.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index ce44097..6570d0e 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -471,7 +471,7 @@ void cmCTestRunTest::ComputeArguments()
this->TestProperties->Args[1].c_str());
++j; //skip the executable (it will be actualCommand)
}
- this->TestCommand
+ std::string testCommand
= cmSystemTools::ConvertToOutputPath(this->ActualCommand.c_str());
//Prepends memcheck args to our command string
@@ -479,22 +479,24 @@ void cmCTestRunTest::ComputeArguments()
for(std::vector<std::string>::iterator i = this->Arguments.begin();
i != this->Arguments.end(); ++i)
{
- this->TestCommand += " ";
- this->TestCommand += cmSystemTools::EscapeSpaces(i->c_str());
+ testCommand += " \"";
+ testCommand += *i;
+ testCommand += "\"";
}
for(;j != this->TestProperties->Args.end(); ++j)
{
- this->TestCommand += " ";
- this->TestCommand += cmSystemTools::EscapeSpaces(j->c_str());
+ testCommand += " \"";
+ testCommand += *j;
+ testCommand += "\"";
this->Arguments.push_back(*j);
}
- this->TestResult.FullCommandLine = this->TestCommand;
+ this->TestResult.FullCommandLine = testCommand;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
<< this->Index << ": "
<< (this->TestHandler->MemCheck?"MemCheck":"Test")
- << " command: " << this->TestCommand
+ << " command: " << testCommand
<< std::endl);
}