diff options
author | Zach Mullen <zach.mullen@kitware.com> | 2009-10-20 14:54:02 (GMT) |
---|---|---|
committer | Zach Mullen <zach.mullen@kitware.com> | 2009-10-20 14:54:02 (GMT) |
commit | f2010871ba9802386cb63733faf6e1a3b762158b (patch) | |
tree | 3e491dd9a6fc4a7b7d5f5737d3440c3ad72c2581 /Source | |
parent | 63ee0333cd6d885f14fcf7f7cca537d294e189b6 (diff) | |
download | CMake-f2010871ba9802386cb63733faf6e1a3b762158b.zip CMake-f2010871ba9802386cb63733faf6e1a3b762158b.tar.gz CMake-f2010871ba9802386cb63733faf6e1a3b762158b.tar.bz2 |
Ctest was broken for subdirs. Restored working directory state for tests so that their executables could be found.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 63dfe7e..1ff5231 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -81,6 +81,10 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test) cmCTestRunTest* testRun = new cmCTestRunTest(this->TestHandler); testRun->SetIndex(test); testRun->SetTestProperties(this->Properties[test]); + + std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory(); + cmSystemTools::ChangeDirectory(this->Properties[test]->Directory.c_str()); + if(testRun->StartTest(this->Total)) { this->RunningTests.insert(testRun); @@ -92,6 +96,7 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test) testRun->EndTest(this->Completed, this->Total, false); this->Failed->push_back(this->Properties[test]->Name); } + cmSystemTools::ChangeDirectory(current_dir.c_str()); } //--------------------------------------------------------- |