diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-11-03 20:38:23 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-11-03 20:38:23 (GMT) |
commit | b1f1118239cafe51ce69170c0d37e6727de8abe5 (patch) | |
tree | a33f463bee0ea8c03d9aecd91bccf0c16b74f126 /Source | |
parent | 5f30c8caac40c930abab4f8c6a9f3fd0ddf1280d (diff) | |
download | CMake-b1f1118239cafe51ce69170c0d37e6727de8abe5.zip CMake-b1f1118239cafe51ce69170c0d37e6727de8abe5.tar.gz CMake-b1f1118239cafe51ce69170c0d37e6727de8abe5.tar.bz2 |
ENH: Cleanup parsing of argument to help fix Bug #259 - CMake does not quote correctly in DartTestfile.txt
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmCTest.cxx | 26 | ||||
-rw-r--r-- | Source/cmCTest.h | 2 |
2 files changed, 10 insertions, 18 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 64af104..2fceb85 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1716,6 +1716,8 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed, std::string testCommand = this->FindTheExecutable(args[1].Value.c_str()); testCommand = cmSystemTools::ConvertToOutputPath(testCommand.c_str()); + std::string actualCommand = testCommand; + // continue if we did not find the executable if (testCommand == "") { @@ -1729,11 +1731,16 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed, std::vector<cmListFileArgument>::const_iterator j = args.begin(); ++j; ++j; + std::vector<const char*> arguments; + arguments.push_back(actualCommand.c_str()); for(;j != args.end(); ++j) { testCommand += " "; 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. */ @@ -1750,7 +1757,7 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed, int res = 0; if ( !m_ShowOnly ) { - res = this->RunTest(testCommand.c_str(), &output, &retVal); + res = this->RunTest(arguments, &output, &retVal); } clock_finish = cmSystemTools::GetTime(); @@ -2410,23 +2417,8 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output, 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 ) { *output = ""; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 44b15dc..ee19740 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -247,7 +247,7 @@ private: //! Run command specialized for tests. Returns process status and retVal is // 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); const char* GetTestStatus(int status); |