Commit 20bb6091 authored by Brad King's avatar Brad King 💬 Committed by Kitware Robot
Browse files

Merge topic 'fix-duplicate-test-run'

2eccdbdc CTest: prevent tests from being inserted in the cost list twice
parents e065decd 2eccdbdc
...@@ -441,6 +441,8 @@ int cmCTestMultiProcessHandler::SearchByName(std::string name) ...@@ -441,6 +441,8 @@ int cmCTestMultiProcessHandler::SearchByName(std::string name)
//--------------------------------------------------------- //---------------------------------------------------------
void cmCTestMultiProcessHandler::CreateTestCostList() void cmCTestMultiProcessHandler::CreateTestCostList()
{ {
TestSet alreadySortedTests;
std::list<TestSet> priorityStack; std::list<TestSet> priorityStack;
priorityStack.push_back(TestSet()); priorityStack.push_back(TestSet());
TestSet &topLevel = priorityStack.back(); TestSet &topLevel = priorityStack.back();
...@@ -456,6 +458,7 @@ void cmCTestMultiProcessHandler::CreateTestCostList() ...@@ -456,6 +458,7 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
{ {
//If the test failed last time, it should be run first. //If the test failed last time, it should be run first.
this->SortedTests.push_back(i->first); this->SortedTests.push_back(i->first);
alreadySortedTests.insert(i->first);
} }
else else
{ {
...@@ -513,7 +516,11 @@ void cmCTestMultiProcessHandler::CreateTestCostList() ...@@ -513,7 +516,11 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
for(TestList::const_iterator j = sortedCopy.begin(); for(TestList::const_iterator j = sortedCopy.begin();
j != sortedCopy.end(); ++j) j != sortedCopy.end(); ++j)
{ {
this->SortedTests.push_back(*j); if(alreadySortedTests.find(*j) == alreadySortedTests.end())
{
this->SortedTests.push_back(*j);
alreadySortedTests.insert(*j);
}
} }
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment