diff options
author | Brad King <brad.king@kitware.com> | 2019-10-29 18:45:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-29 19:10:12 (GMT) |
commit | 80c2c9d14cf1c1a8f162e119bd00d5f483a94af2 (patch) | |
tree | 273a15083c42453ee3265a3ce8263bf7a74a3e3e /Source/CTest/cmCTestRunTest.h | |
parent | 0187e522448c8fe92c15d4a983afac36950d1d59 (diff) | |
download | CMake-80c2c9d14cf1c1a8f162e119bd00d5f483a94af2.zip CMake-80c2c9d14cf1c1a8f162e119bd00d5f483a94af2.tar.gz CMake-80c2c9d14cf1c1a8f162e119bd00d5f483a94af2.tar.bz2 |
ctest: Add --repeat-until-pass option
Add an option to re-run tests if they fail. This will help tolerate
sporadic failures.
Issue: #17010
Co-Author: Ben Boeckel <ben.boeckel@kitware.com>
Co-Author: Chuck Atkins <chuck.atkins@kitware.com>
Diffstat (limited to 'Source/CTest/cmCTestRunTest.h')
-rw-r--r-- | Source/CTest/cmCTestRunTest.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 7b202d1..881cbb6 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -13,13 +13,12 @@ #include <stddef.h> +#include "cmCTest.h" #include "cmCTestMultiProcessHandler.h" #include "cmCTestTestHandler.h" #include "cmDuration.h" #include "cmProcess.h" -class cmCTest; - /** \class cmRunTest * \brief represents a single test to be run * @@ -30,8 +29,13 @@ class cmCTestRunTest public: explicit cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler); - void SetNumberOfRuns(int n) { this->NumberOfRunsLeft = n; } - void SetRunUntilFailOn() { this->RunUntilFail = true; } + void SetNumberOfRuns(int n) + { + this->NumberOfRunsLeft = n; + this->NumberOfRunsTotal = n; + } + + void SetRerunMode(cmCTest::Rerun r) { this->RerunMode = r; } void SetTestProperties(cmCTestTestHandler::cmCTestTestProperties* prop) { this->TestProperties = prop; @@ -129,8 +133,9 @@ private: std::vector<std::map< std::string, std::vector<cmCTestMultiProcessHandler::HardwareAllocation>>> AllocatedHardware; - bool RunUntilFail = false; // default to run the test once + cmCTest::Rerun RerunMode = cmCTest::Rerun::Never; int NumberOfRunsLeft = 1; // default to 1 run of the test + int NumberOfRunsTotal = 1; // default to 1 run of the test bool RunAgain = false; // default to not having to run again size_t TotalNumberOfTests; }; |