summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestTestHandler.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-08-03 14:24:59 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-08-03 14:48:43 (GMT)
commitba4886b717d4c72f4b7c8960862ff44af187d114 (patch)
treea0dab5ad8bc0eff862648dba9a1761854f8de95c /Source/CTest/cmCTestTestHandler.cxx
parent14e54c4c449e2704799ab5283c6c6764472d5a0a (diff)
downloadCMake-ba4886b717d4c72f4b7c8960862ff44af187d114.zip
CMake-ba4886b717d4c72f4b7c8960862ff44af187d114.tar.gz
CMake-ba4886b717d4c72f4b7c8960862ff44af187d114.tar.bz2
CTest: print failed tests in index order (#11746)
This deterministic ordering makes it easier for a developer comparing the ctest output of two test runs to see what changed from run to run. Thanks to Fraser Hutchison for the patch.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b824e47..078e430 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -33,6 +33,7 @@
#include <float.h>
#include <memory> // auto_ptr
+#include <set>
//----------------------------------------------------------------------
class cmCTestSubdirCommand : public cmCommand
@@ -617,9 +618,12 @@ int cmCTestTestHandler::ProcessHandler()
<< "The following tests FAILED:" << std::endl);
this->StartLogFile("TestsFailed", ofs);
- std::vector<cmCTestTestHandler::cmCTestTestResult>::iterator ftit;
- for(ftit = this->TestResults.begin();
- ftit != this->TestResults.end(); ++ftit)
+ typedef std::set<cmCTestTestHandler::cmCTestTestResult,
+ cmCTestTestResultLess> SetOfTests;
+ SetOfTests resultsSet(this->TestResults.begin(), this->TestResults.end());
+
+ for(SetOfTests::iterator ftit = resultsSet.begin();
+ ftit != resultsSet.end(); ++ftit)
{
if ( ftit->Status != cmCTestTestHandler::COMPLETED )
{