From 2eccdbdc2a7d39a1a56e5ed78abb65ad286b7125 Mon Sep 17 00:00:00 2001 From: Nils Gladitz Date: Thu, 31 Oct 2013 22:10:56 +0100 Subject: [PATCH] CTest: prevent tests from being inserted in the cost list twice --- Source/CTest/cmCTestMultiProcessHandler.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 6e9d0e3d3..4c39d105b 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -441,6 +441,8 @@ int cmCTestMultiProcessHandler::SearchByName(std::string name) //--------------------------------------------------------- void cmCTestMultiProcessHandler::CreateTestCostList() { + TestSet alreadySortedTests; + std::list priorityStack; priorityStack.push_back(TestSet()); TestSet &topLevel = priorityStack.back(); @@ -456,6 +458,7 @@ void cmCTestMultiProcessHandler::CreateTestCostList() { //If the test failed last time, it should be run first. this->SortedTests.push_back(i->first); + alreadySortedTests.insert(i->first); } else { @@ -513,7 +516,11 @@ void cmCTestMultiProcessHandler::CreateTestCostList() for(TestList::const_iterator j = sortedCopy.begin(); j != sortedCopy.end(); ++j) { - this->SortedTests.push_back(*j); + if(alreadySortedTests.find(*j) == alreadySortedTests.end()) + { + this->SortedTests.push_back(*j); + alreadySortedTests.insert(*j); + } } } }