summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestMultiProcessHandler.cxx
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2013-10-17 20:10:35 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2013-10-17 20:10:35 (GMT)
commit44017a4767e183d93b4c3f8f9c3000bbc4e33d2b (patch)
tree72e825f7bef093d9e4a2f9728b1bbaa1fd1e05c0 /Source/CTest/cmCTestMultiProcessHandler.cxx
parent8f2b0c330706fe479fb0804b3526bf28503cd52a (diff)
downloadCMake-44017a4767e183d93b4c3f8f9c3000bbc4e33d2b.zip
CMake-44017a4767e183d93b4c3f8f9c3000bbc4e33d2b.tar.gz
CMake-44017a4767e183d93b4c3f8f9c3000bbc4e33d2b.tar.bz2
CTest: handle dependent and non dependent test requirements equally
Diffstat (limited to 'Source/CTest/cmCTestMultiProcessHandler.cxx')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx49
1 files changed, 9 insertions, 40 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 76ddeea..794ce7a 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -210,30 +210,7 @@ bool cmCTestMultiProcessHandler::StartTest(int test)
// and we don't want to be iterating a list while removing from it
TestSet depends = this->Tests[test];
size_t totalDepends = depends.size();
- if(totalDepends)
- {
- for(TestSet::const_iterator i = depends.begin();
- i != depends.end(); ++i)
- {
- // if the test is not already running then start it
- if(!this->TestRunningMap[*i])
- {
- // this test might be finished, but since
- // this is a copy of the depend map we might
- // still have it
- if(!this->TestFinishMap[*i])
- {
- // only start one test in this function
- return this->StartTest(*i);
- }
- else
- {
- // the depend has been and finished
- totalDepends--;
- }
- }
- }
- }
+
// if there are no depends left then run this test
if(totalDepends == 0)
{
@@ -262,25 +239,17 @@ void cmCTestMultiProcessHandler::StartNextTests()
TestList copy = this->SortedTests;
for(TestList::iterator test = copy.begin(); test != copy.end(); ++test)
{
- //in case this test has already been started due to dependency
- if(this->TestRunningMap[*test] || this->TestFinishMap[*test])
- {
- continue;
- }
size_t processors = GetProcessorsUsed(*test);
- if(processors > numToStart)
- {
- return;
- }
- if(this->StartTest(*test))
+
+ if(processors <= numToStart && this->StartTest(*test))
{
- if(this->StopTimePassed)
- {
- return;
- }
- numToStart -= processors;
+ if(this->StopTimePassed)
+ {
+ return;
+ }
+ numToStart -= processors;
}
- if(numToStart == 0)
+ else if(numToStart == 0)
{
return;
}