summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2013-10-21 17:55:14 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2013-10-21 17:55:14 (GMT)
commit384beffc39a00c97ff23a8149e62af5b1cffc0ae (patch)
treee3a2d4e8469b3bc97488127e42e3cdc6e633fdc7 /Source/CTest
parentadbe00d6e10906466c82ac3ddc8ef2d14a98a417 (diff)
downloadCMake-384beffc39a00c97ff23a8149e62af5b1cffc0ae.zip
CMake-384beffc39a00c97ff23a8149e62af5b1cffc0ae.tar.gz
CMake-384beffc39a00c97ff23a8149e62af5b1cffc0ae.tar.bz2
CTest: added comments that describe the basic test sorting approach
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 510d3c5..3dd446b 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -445,6 +445,8 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
priorityStack.push_back(TestSet());
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();
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())
{
TestSet &previousSet = priorityStack.back();
@@ -480,8 +484,11 @@ void cmCTestMultiProcessHandler::CreateTestCostList()
}
}
+ // Remove the empty dependency level
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();
i != priorityStack.rend(); ++i)
{