summaryrefslogtreecommitdiffstats
path: root/Source/ctest.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-02-26 20:15:16 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-02-26 20:15:16 (GMT)
commit0b6f8be725a48e929bcf7c2e8003ef2f03494b06 (patch)
tree31361599b6ad4019d441b1a2c8fdffbea3b9c30d /Source/ctest.cxx
parent800db3a063b766ccab03afa7bae397700f8f2fe6 (diff)
downloadCMake-0b6f8be725a48e929bcf7c2e8003ef2f03494b06.zip
CMake-0b6f8be725a48e929bcf7c2e8003ef2f03494b06.tar.gz
CMake-0b6f8be725a48e929bcf7c2e8003ef2f03494b06.tar.bz2
add command line option -D for config directory to run
Diffstat (limited to 'Source/ctest.cxx')
-rw-r--r--Source/ctest.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index ad76486..43a9f66 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<std::string> &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;