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/CTest/cmCTestRunTest.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/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index ce9e13b..ba14653 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -345,7 +345,9 @@ bool cmCTestRunTest::NeedsToRerun() if ((this->RerunMode == cmCTest::Rerun::UntilFail && this->TestResult.Status == cmCTestTestHandler::COMPLETED) || (this->RerunMode == cmCTest::Rerun::UntilPass && - this->TestResult.Status != cmCTestTestHandler::COMPLETED)) { + this->TestResult.Status != cmCTestTestHandler::COMPLETED) || + (this->RerunMode == cmCTest::Rerun::AfterTimeout && + this->TestResult.Status == cmCTestTestHandler::TIMEOUT)) { this->RunAgain = true; return true; } @@ -745,10 +747,11 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total) // then it will never print out the completed / total, same would // got for run until pass. Trick is when this is called we don't // yet know if we are passing or failing. - if ((this->RerunMode != cmCTest::Rerun::UntilPass && - this->NumberOfRunsLeft == 1) || - (this->RerunMode == cmCTest::Rerun::UntilPass && - this->NumberOfRunsLeft == this->NumberOfRunsTotal) || + bool const progressOnLast = + (this->RerunMode != cmCTest::Rerun::UntilPass && + this->RerunMode != cmCTest::Rerun::AfterTimeout); + if ((progressOnLast && this->NumberOfRunsLeft == 1) || + (!progressOnLast && this->NumberOfRunsLeft == this->NumberOfRunsTotal) || this->CTest->GetTestProgressOutput()) { outputStream << std::setw(getNumWidth(total)) << completed << "/"; outputStream << std::setw(getNumWidth(total)) << total << " "; |