summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2004-01-09 18:35:18 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2004-01-09 18:35:18 (GMT)
commit67f1dab2b5e69474cc4df000cdbd2d3135981c5b (patch)
tree6e6cb48b51029e190ca786127b5ff6cf8f6dbe00 /Source/cmCTest.cxx
parent972e09029de2c9b403c29047c216739cf195e5c7 (diff)
downloadCMake-67f1dab2b5e69474cc4df000cdbd2d3135981c5b.zip
CMake-67f1dab2b5e69474cc4df000cdbd2d3135981c5b.tar.gz
CMake-67f1dab2b5e69474cc4df000cdbd2d3135981c5b.tar.bz2
ENH: add an ability to specify a build run directory
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index d669017..eba1193 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -3703,6 +3703,11 @@ int cmCTest::Run(std::vector<std::string>const& args, std::string* output)
i++;
m_BuildTarget = args[i];
}
+ if(arg.find("--build-run-dir",0) == 0 && i < args.size() - 1)
+ {
+ i++;
+ m_BuildRunDir = args[i];
+ }
if(arg.find("--build-two-config",0) == 0 && i < args.size() - 1)
{
m_BuildTwoConfig = true;
@@ -4050,6 +4055,11 @@ int cmCTest::RunCMakeAndTest(std::string* outstring)
*outstring += output;
}
+ if(m_TestCommand.size() == 0)
+ {
+ return retVal;
+ }
+
// now run the compiled test if we can find it
// See if the executable exists as written.
std::vector<std::string> failed;
@@ -4149,7 +4159,12 @@ int cmCTest::RunCMakeAndTest(std::string* outstring)
testCommand.push_back(0);
std::string outs;
int retval = 0;
- out << "Running test executable: " << fullPath << "\n";
+ out << "Running test executable: " << fullPath << "\n";
+ // run the test from the m_BuildRunDir if set
+ if(m_BuildRunDir.size())
+ {
+ cmSystemTools::ChangeDirectory(m_BuildRunDir.c_str());
+ }
this->RunTest(testCommand, &outs, &retval);
out << outs << "\n";
if(outstring)