From 6d4d7ca9551e60592003272a3a2039af4dee192e Mon Sep 17 00:00:00 2001 From: Nils Gladitz Date: Sat, 19 Oct 2013 08:52:28 +0200 Subject: CTest: consider previously failed tests before all others --- Source/CTest/cmCTestMultiProcessHandler.cxx | 25 ++++++++++--------------- 1 file 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::reverse_iterator i = priorityStack.rbegin(); i != priorityStack.rend(); ++i) { -- cgit v0.12