ENH: Cleanup parsing of argument to help fix Bug #259 - CMake does not quote correctly in DartTestfile.txt
This commit is contained in:
parent
5f30c8caac
commit
b1f1118239
|
@ -1716,6 +1716,8 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
|
||||||
std::string testCommand = this->FindTheExecutable(args[1].Value.c_str());
|
std::string testCommand = this->FindTheExecutable(args[1].Value.c_str());
|
||||||
testCommand = cmSystemTools::ConvertToOutputPath(testCommand.c_str());
|
testCommand = cmSystemTools::ConvertToOutputPath(testCommand.c_str());
|
||||||
|
|
||||||
|
std::string actualCommand = testCommand;
|
||||||
|
|
||||||
// continue if we did not find the executable
|
// continue if we did not find the executable
|
||||||
if (testCommand == "")
|
if (testCommand == "")
|
||||||
{
|
{
|
||||||
|
@ -1729,11 +1731,16 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
|
||||||
std::vector<cmListFileArgument>::const_iterator j = args.begin();
|
std::vector<cmListFileArgument>::const_iterator j = args.begin();
|
||||||
++j;
|
++j;
|
||||||
++j;
|
++j;
|
||||||
|
std::vector<const char*> arguments;
|
||||||
|
arguments.push_back(actualCommand.c_str());
|
||||||
for(;j != args.end(); ++j)
|
for(;j != args.end(); ++j)
|
||||||
{
|
{
|
||||||
testCommand += " ";
|
testCommand += " ";
|
||||||
testCommand += cmSystemTools::EscapeSpaces(j->Value.c_str());
|
testCommand += cmSystemTools::EscapeSpaces(j->Value.c_str());
|
||||||
|
arguments.push_back(j->Value.c_str());
|
||||||
}
|
}
|
||||||
|
arguments.push_back(0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run an executable command and put the stdout in output.
|
* Run an executable command and put the stdout in output.
|
||||||
*/
|
*/
|
||||||
|
@ -1750,7 +1757,7 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
|
||||||
int res = 0;
|
int res = 0;
|
||||||
if ( !m_ShowOnly )
|
if ( !m_ShowOnly )
|
||||||
{
|
{
|
||||||
res = this->RunTest(testCommand.c_str(), &output, &retVal);
|
res = this->RunTest(arguments, &output, &retVal);
|
||||||
}
|
}
|
||||||
clock_finish = cmSystemTools::GetTime();
|
clock_finish = cmSystemTools::GetTime();
|
||||||
|
|
||||||
|
@ -2410,23 +2417,8 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmCTest::RunTest( const char* command, std::string* output, int *retVal)
|
int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, int *retVal)
|
||||||
{
|
{
|
||||||
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
|
|
||||||
|
|
||||||
if(args.size() < 1)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<const char*> argv;
|
|
||||||
for(std::vector<cmStdString>::const_iterator a = args.begin();
|
|
||||||
a != args.end(); ++a)
|
|
||||||
{
|
|
||||||
argv.push_back(a->c_str());
|
|
||||||
}
|
|
||||||
argv.push_back(0);
|
|
||||||
|
|
||||||
if ( output )
|
if ( output )
|
||||||
{
|
{
|
||||||
*output = "";
|
*output = "";
|
||||||
|
|
|
@ -247,7 +247,7 @@ private:
|
||||||
|
|
||||||
//! Run command specialized for tests. Returns process status and retVal is
|
//! Run command specialized for tests. Returns process status and retVal is
|
||||||
// return value or exception.
|
// return value or exception.
|
||||||
int RunTest( const char* command, std::string* output, int *retVal);
|
int RunTest(std::vector<const char*> args, std::string* output, int *retVal);
|
||||||
|
|
||||||
std::string GenerateRegressionImages(const std::string& xml);
|
std::string GenerateRegressionImages(const std::string& xml);
|
||||||
const char* GetTestStatus(int status);
|
const char* GetTestStatus(int status);
|
||||||
|
|
Loading…
Reference in New Issue