diff options
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index e1f829d..a9aaf0c 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -448,7 +448,16 @@ void cmCTestMultiProcessHandler::CreateTestCostList() for(TestMap::const_iterator i = this->Tests.begin(); i != this->Tests.end(); ++i) { - topLevel.insert(i->first); + if(std::find(this->LastTestsFailed.begin(), this->LastTestsFailed.end(), + this->Properties[i->first]->Name) != this->LastTestsFailed.end()) + { + //If the test failed last time, it should be run first. + this->SortedTests.push_back(i->first); + } + else + { + topLevel.insert(i->first); + } } while(priorityStack.back().size()) @@ -473,20 +482,6 @@ void cmCTestMultiProcessHandler::CreateTestCostList() priorityStack.pop_back(); - for(TestMap::iterator i = this->Tests.begin(); - i != this->Tests.end(); ++i) - { - //If the test failed last time, it should be run first, so max the cost. - //Only do this for parallel runs; in non-parallel runs, avoid clobbering - //the test's explicitly set cost. - if(this->ParallelLevel > 1 && - std::find(this->LastTestsFailed.begin(), this->LastTestsFailed.end(), - this->Properties[i->first]->Name) != this->LastTestsFailed.end()) - { - this->Properties[i->first]->Cost = FLT_MAX; - } - } - for(std::list<TestSet>::reverse_iterator i = priorityStack.rbegin(); i != priorityStack.rend(); ++i) { |