diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2015-03-05 21:51:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-03-23 13:08:22 (GMT) |
commit | fde70a1b26e130663cc4c02e0530d3aadc165a41 (patch) | |
tree | eac5b5a1a6cfe1709259430eb22e5f7a7cea48ad /Source/CTest/cmCTestMultiProcessHandler.cxx | |
parent | 56be75b3107b210631919c13496060d648f97b14 (diff) | |
download | CMake-fde70a1b26e130663cc4c02e0530d3aadc165a41.zip CMake-fde70a1b26e130663cc4c02e0530d3aadc165a41.tar.gz CMake-fde70a1b26e130663cc4c02e0530d3aadc165a41.tar.bz2 |
ctest: Add a new --repeat-until-fail option
This option tells ctest to run each test N times until the test fails or
the N times have run. This is useful for finding random failing tests.
Diffstat (limited to 'Source/CTest/cmCTestMultiProcessHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index eb33d8e..bd090db 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -121,6 +121,11 @@ void cmCTestMultiProcessHandler::StartTestProcess(int test) this->RunningCount += GetProcessorsUsed(test); cmCTestRunTest* testRun = new cmCTestRunTest(this->TestHandler); + if(this->CTest->GetRepeatUntilFail()) + { + testRun->SetRunUntilFailOn(); + testRun->SetNumberOfRuns(this->CTest->GetTestRepeat()); + } testRun->SetIndex(test); testRun->SetTestProperties(this->Properties[test]); @@ -289,7 +294,13 @@ bool cmCTestMultiProcessHandler::CheckOutput() cmCTestRunTest* p = *i; int test = p->GetIndex(); - if(p->EndTest(this->Completed, this->Total, true)) + bool testResult = p->EndTest(this->Completed, this->Total, true); + if(p->StartAgain()) + { + this->Completed--; // remove the completed test because run again + continue; + } + if(testResult) { this->Passed->push_back(p->GetTestProperties()->Name); } |