Ctest was broken for subdirs. Restored working directory state for tests so that their executables could be found.

This commit is contained in:
Zach Mullen 2009-10-20 10:54:02 -04:00
parent 63ee0333cd
commit f2010871ba
1 changed files with 5 additions and 0 deletions

View File

@ -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());
}
//---------------------------------------------------------