Merge topic 'fix-duplicate-test-run'

2eccdbd CTest: prevent tests from being inserted in the cost list twice
This commit is contained in:
Brad King 2013-11-01 09:40:26 -04:00 committed by CMake Topic Stage
commit 20bb609171
1 changed files with 8 additions and 1 deletions

View File

@ -441,6 +441,8 @@ int cmCTestMultiProcessHandler::SearchByName(std::string name)
//---------------------------------------------------------
void cmCTestMultiProcessHandler::CreateTestCostList()
{
TestSet alreadySortedTests;
std::list<TestSet> 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);
}
}
}
}