From 0b6f8be725a48e929bcf7c2e8003ef2f03494b06 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 26 Feb 2002 15:15:16 -0500 Subject: [PATCH] add command line option -D for config directory to run --- Source/ctest.cxx | 22 ++++++++++++++++++++-- Source/ctest.h | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Source/ctest.cxx b/Source/ctest.cxx index ad76486f1..43a9f667e 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -58,7 +58,21 @@ std::string ctest::FindExecutable(const char *exe) std::string file; cmSystemTools::SplitProgramPath(exe, dir, file); - + if(m_ConfigType != "") + { + if(TryExecutable(dir.c_str(), file.c_str(), &fullPath, m_ConfigType.c_str())) + { + return fullPath; + } + std::string tried = dir; + dir += "/"; + dir += m_ConfigType; + dir += "/"; + dir += file; + cmSystemTools::Error("config type specified on the command line, but test executable not found.", + dir.c_str()); + return ""; + } if (TryExecutable(dir.c_str(),file.c_str(),&fullPath,".")) { return fullPath; @@ -183,7 +197,6 @@ void ctest::ProcessDirectory(int &passed, std::vector &failed) */ std::string output; int retVal; - if (!cmSystemTools::RunCommand(testCommand.c_str(), output, retVal, false) || retVal != 0) { @@ -245,6 +258,11 @@ int main (int argc, char *argv[]) for(unsigned int i=1; i < args.size(); ++i) { std::string arg = args[i]; + if(arg.find("-D",0) == 0 && i < args.size() - 1) + { + inst.m_ConfigType = args[i+1]; + } + if(arg.find("-R",0) == 0 && i < args.size() - 1) { inst.m_UseRegExp = true; diff --git a/Source/ctest.h b/Source/ctest.h index 251977afe..eef6b288c 100644 --- a/Source/ctest.h +++ b/Source/ctest.h @@ -40,7 +40,7 @@ public: bool m_UseRegExp; std::string m_RegExp; - + std::string m_ConfigType; private: };