diff options
author | Brad King <brad.king@kitware.com> | 2019-10-29 18:21:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-29 19:14:36 (GMT) |
commit | 39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc (patch) | |
tree | 284a7da62ff3285b1809618e822dd1c693ec03dd /Source/cmCTest.cxx | |
parent | 80c2c9d14cf1c1a8f162e119bd00d5f483a94af2 (diff) | |
download | CMake-39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc.zip CMake-39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc.tar.gz CMake-39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc.tar.bz2 |
ctest: Add --repeat-after-timeout option
Add an option to re-run tests if they timeout. This will help tolerate
sporadic timeouts on busy machines.
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 7276d98..20445b0 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1884,6 +1884,28 @@ bool cmCTest::HandleCommandLineArguments(size_t& i, } } + if (this->CheckArgument(arg, "--repeat-after-timeout")) { + if (i >= args.size() - 1) { + errormsg = "'--repeat-after-timeout' requires an argument"; + return false; + } + if (this->Impl->RerunMode != cmCTest::Rerun::Never) { + errormsg = "At most one '--repeat-*' option may be used."; + return false; + } + i++; + long repeat = 1; + if (!cmStrToLong(args[i], &repeat)) { + errormsg = + "'--repeat-after-timeout' given non-integer value '" + args[i] + "'"; + return false; + } + this->Impl->RepeatTests = static_cast<int>(repeat); + if (repeat > 1) { + this->Impl->RerunMode = cmCTest::Rerun::AfterTimeout; + } + } + if (this->CheckArgument(arg, "--test-load") && i < args.size() - 1) { i++; unsigned long load; |