summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestMultiProcessHandler.cxx
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2013-10-19 06:52:28 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2013-10-19 06:52:28 (GMT)
commit6d4d7ca9551e60592003272a3a2039af4dee192e (patch)
tree8b29d0eece684654f357c7601698f3fd029628f9 /Source/CTest/cmCTestMultiProcessHandler.cxx
parente809d8cfdf080e0f34122ef4aac0b1a93c6a7f6a (diff)
downloadCMake-6d4d7ca9551e60592003272a3a2039af4dee192e.zip
CMake-6d4d7ca9551e60592003272a3a2039af4dee192e.tar.gz
CMake-6d4d7ca9551e60592003272a3a2039af4dee192e.tar.bz2
CTest: consider previously failed tests before all others
Diffstat (limited to 'Source/CTest/cmCTestMultiProcessHandler.cxx')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx25
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)
{