CTest: added comments that describe the basic test sorting approach

This commit is contained in:
Nils Gladitz 2013-10-21 19:55:14 +02:00
parent adbe00d6e1
commit 384beffc39
1 changed files with 7 additions and 0 deletions

View File

@ -445,6 +445,8 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
priorityStack.push_back(TestSet()); priorityStack.push_back(TestSet());
TestSet &topLevel = priorityStack.back(); TestSet &topLevel = priorityStack.back();
// Add previously failed tests to the front of the cost list
// and queue other tests for further sorting
for(TestMap::const_iterator i = this->Tests.begin(); for(TestMap::const_iterator i = this->Tests.begin();
i != this->Tests.end(); ++i) i != this->Tests.end(); ++i)
{ {
@ -460,6 +462,8 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
} }
} }
// Repeatedly move dependencies of the tests on the current dependency level
// to the next level until no further dependencies exist.
while(priorityStack.back().size()) while(priorityStack.back().size())
{ {
TestSet &previousSet = priorityStack.back(); TestSet &previousSet = priorityStack.back();
@ -480,8 +484,11 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
} }
} }
// Remove the empty dependency level
priorityStack.pop_back(); priorityStack.pop_back();
// Reverse iterate over the different dependency levels (deepest first).
// Sort tests within each level by COST and append them to the cost list.
for(std::list<TestSet>::reverse_iterator i = priorityStack.rbegin(); for(std::list<TestSet>::reverse_iterator i = priorityStack.rbegin();
i != priorityStack.rend(); ++i) i != priorityStack.rend(); ++i)
{ {