diff options
author | Brad King <brad.king@kitware.com> | 2002-12-11 23:13:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2002-12-11 23:13:33 (GMT) |
commit | 4888c088ae0ca829862e8b2f9568abca12dc34d1 (patch) | |
tree | 2c0fb825f1d1adff97d98373b555f00b84da14f7 /Source/ctest.cxx | |
parent | 5a321605bcc15c7e559c8da5168eef00796148b1 (diff) | |
download | CMake-4888c088ae0ca829862e8b2f9568abca12dc34d1.zip CMake-4888c088ae0ca829862e8b2f9568abca12dc34d1.tar.gz CMake-4888c088ae0ca829862e8b2f9568abca12dc34d1.tar.bz2 |
ENH: Moved ExpandListVariables out of individual commands. Argument evaluation rules are now very consistent. Double quotes can always be used to create exactly one argument, regardless of contents inside.
Diffstat (limited to 'Source/ctest.cxx')
-rw-r--r-- | Source/ctest.cxx | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Source/ctest.cxx b/Source/ctest.cxx index 4fba9b1..20a183e 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -17,6 +17,7 @@ #include "ctest.h" #include "cmRegularExpression.h" #include "cmSystemTools.h" +#include "cmListFileCache.h" #include <stdio.h> #include <time.h> @@ -1111,17 +1112,19 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed, bool parseError; while ( fin ) { - if(cmSystemTools::ParseFunction(fin, name, args, "DartTestfile.txt", - parseError)) + cmListFileFunction lff; + if(cmListFileCache::ParseFunction(fin, lff, "DartTestfile.txt", parseError)) { + const std::string& name = lff.m_Name; + const std::vector<cmListFileArgument>& args = lff.m_Arguments; if (name == "SUBDIRS") { std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); - for(std::vector<std::string>::iterator j = args.begin(); + for(std::vector<cmListFileArgument>::const_iterator j = args.begin(); j != args.end(); ++j) { std::string nwd = cwd + "/"; - nwd += *j; + nwd += j->Value; if (cmSystemTools::FileIsDirectory(nwd.c_str())) { cmSystemTools::ChangeDirectory(nwd.c_str()); @@ -1136,17 +1139,17 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed, { if (this->m_UseExcludeRegExp && this->m_UseExcludeRegExpFirst && - ereg.find(args[0].c_str())) + ereg.find(args[0].Value.c_str())) { continue; } - if (this->m_UseIncludeRegExp && !ireg.find(args[0].c_str())) + if (this->m_UseIncludeRegExp && !ireg.find(args[0].Value.c_str())) { continue; } if (this->m_UseExcludeRegExp && !this->m_UseExcludeRegExpFirst && - ereg.find(args[0].c_str())) + ereg.find(args[0].Value.c_str())) { continue; } @@ -1159,30 +1162,30 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed, std::cerr << "Changing directory into " << nwd.c_str() << "\n"; firstTest = 0; } - cres.m_Name = args[0]; - fprintf(stderr,"Testing %-30s ",args[0].c_str()); + cres.m_Name = args[0].Value; + fprintf(stderr,"Testing %-30s ",args[0].Value.c_str()); fflush(stderr); //std::cerr << "Testing " << args[0] << " ... "; // find the test executable - std::string testCommand = this->FindExecutable(args[1].c_str()); + std::string testCommand = this->FindExecutable(args[1].Value.c_str()); testCommand = cmSystemTools::ConvertToOutputPath(testCommand.c_str()); // continue if we did not find the executable if (testCommand == "") { std::cerr << "Unable to find executable: " << - args[1].c_str() << "\n"; + args[1].Value.c_str() << "\n"; continue; } // add the arguments - std::vector<std::string>::iterator j = args.begin(); + std::vector<cmListFileArgument>::const_iterator j = args.begin(); ++j; ++j; for(;j != args.end(); ++j) { testCommand += " "; - testCommand += cmSystemTools::EscapeSpaces(j->c_str()); + testCommand += cmSystemTools::EscapeSpaces(j->Value.c_str()); } /** * Run an executable command and put the stdout in output. @@ -1219,7 +1222,7 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed, std::cerr << output.c_str() << "\n"; } } - failed.push_back(args[0]); + failed.push_back(args[0].Value); } else { @@ -1236,7 +1239,7 @@ void ctest::ProcessDirectory(std::vector<std::string> &passed, std::cerr << output.c_str() << "\n"; } } - passed.push_back(args[0]); + passed.push_back(args[0].Value); } cres.m_Output = output; cres.m_ReturnValue = retVal; |