summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.cxx
diff options
context:
space:
mode:
authorZach Mullen <zach.mullen@kitware.com>2009-12-10 19:38:32 (GMT)
committerZach Mullen <zach.mullen@kitware.com>2009-12-10 19:38:32 (GMT)
commit48b613392848610d243962086fb289a93cc41f0d (patch)
tree19804350ca0fe4748a6b3c8fc64fc1bd98563dac /Source/CTest/cmCTestTestHandler.cxx
parent55275e017dfdd2826e2791ac16d29ea0cdfc55ac (diff)
downloadCMake-48b613392848610d243962086fb289a93cc41f0d.zip
CMake-48b613392848610d243962086fb289a93cc41f0d.tar.gz
CMake-48b613392848610d243962086fb289a93cc41f0d.tar.bz2
[0008668: CTest Dev: Missing executables shown as failed tests when using MPI.] Added a wrapping option to add_test so that exes built by the project can be safely wrapped in other exes and be listed as "not run" rather than "failed" if they are not built.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx30
1 files changed, 28 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index cbac272..dadd39c 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -269,7 +269,30 @@ bool cmCTestAddTestCommand
this->SetError("called with incorrect number of arguments");
return false;
}
- return this->TestHandler->AddTest(args);
+
+ bool prefixCmdFound = false;
+ std::vector<std::string> actualArgs, prefix;
+
+ //separate the regular command and the prefix command (bug 8668)
+ for(std::vector<std::string>::const_iterator i = args.begin();
+ i != args.end(); ++i)
+ {
+ if(*i == "EXEC_PREFIX_CMD")
+ {
+ prefixCmdFound = true;
+ continue;
+ }
+ if(prefixCmdFound)
+ {
+ prefix.push_back(*i);
+ }
+ else
+ {
+ actualArgs.push_back(*i);
+ }
+ }
+
+ return this->TestHandler->AddTest(actualArgs, prefix);
}
//----------------------------------------------------------------------
@@ -2104,10 +2127,12 @@ bool cmCTestTestHandler::SetTestsProperties(
}
//----------------------------------------------------------------------
-bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
+bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args,
+ const std::vector<std::string>& prefix)
{
const std::string& testname = args[0];
cmCTestLog(this->CTest, DEBUG, "Add test: " << args[0] << std::endl);
+
if (this->UseExcludeRegExpFlag &&
this->UseExcludeRegExpFirst &&
this->ExcludeTestsRegularExpression.find(testname.c_str()))
@@ -2158,6 +2183,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
cmCTestTestProperties test;
test.Name = testname;
test.Args = args;
+ test.PrefixArgs = prefix;
test.Directory = cmSystemTools::GetCurrentWorkingDirectory();
cmCTestLog(this->CTest, DEBUG, "Set test directory: "
<< test.Directory << std::endl);