diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2013-09-24 18:20:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-10-08 13:18:13 (GMT) |
commit | eb2decc02d28f41a3e189d5387be24552c42060f (patch) | |
tree | f1995da8fc935d3ed8831213da02534eab5e7ce2 /Source/CTest/cmCTestTestHandler.h | |
parent | 475635ec0f3eeae9f6db0f9daa8a9c4cd8b3f989 (diff) | |
download | CMake-eb2decc02d28f41a3e189d5387be24552c42060f.zip CMake-eb2decc02d28f41a3e189d5387be24552c42060f.tar.gz CMake-eb2decc02d28f41a3e189d5387be24552c42060f.tar.bz2 |
ctest: Add --rerun-failed option
Add a new command line argument to ctest. This allows users to
rerun tests that failed during the previous call to ctest. This
is accomplished by analyzing the most recently modified file named
"^LastTestsFailed*" in the Testing/Temporary subdirectory of the
project's binary directory.
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.h')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 93b793b..398f052 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -44,6 +44,12 @@ public: void SetUseUnion(bool val) { this->UseUnion = val; } /** + * Set whether or not CTest should only execute the tests that failed + * on the previous run. By default this is false. + */ + void SetRerunFailed(bool val) { this->RerunFailed = val; } + + /** * This method is called when reading CTest custom file */ void PopulateCustomVectors(cmMakefile *mf); @@ -213,6 +219,12 @@ private: // based on union regex and -I stuff void ComputeTestList(); + // compute the lists of tests that will actually run + // based on LastTestFailed.log + void ComputeTestListForRerunFailed(); + + void UpdateMaxTestNameWidth(); + bool GetValue(const char* tag, std::string& value, std::ifstream& fin); @@ -235,6 +247,7 @@ private: const char* GetTestStatus(int status); void ExpandTestsToRunInformation(size_t numPossibleTests); + void ExpandTestsToRunInformationForRerunFailed(); std::vector<cmStdString> CustomPreTest; std::vector<cmStdString> CustomPostTest; @@ -268,6 +281,8 @@ private: cmsys::RegularExpression DartStuff; std::ostream* LogFile; + + bool RerunFailed; }; #endif |