diff options
author | Johnny Jazeix <jazeix@gmail.com> | 2020-04-20 21:05:15 (GMT) |
---|---|---|
committer | Johnny Jazeix <jazeix@gmail.com> | 2020-04-20 21:05:15 (GMT) |
commit | e89aeba5c4733964db15e0d147e063af34205d54 (patch) | |
tree | 2b5e1da00d132d9e60b8355f6de72427b44faa62 /Source/CTest/cmCTestMultiProcessHandler.cxx | |
parent | df2d39bc512bd09ae808e8a2a6c7523737bb26c0 (diff) | |
download | CMake-e89aeba5c4733964db15e0d147e063af34205d54.zip CMake-e89aeba5c4733964db15e0d147e063af34205d54.tar.gz CMake-e89aeba5c4733964db15e0d147e063af34205d54.tar.bz2 |
ctest: add option --stop-on-failure
To stop the tests once one has failed
Fixes: #16628
Diffstat (limited to 'Source/CTest/cmCTestMultiProcessHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 3fc417a..5c37f97 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -137,7 +137,7 @@ void cmCTestMultiProcessHandler::RunTests() uv_run(&this->Loop, UV_RUN_DEFAULT); uv_loop_close(&this->Loop); - if (!this->StopTimePassed) { + if (!this->StopTimePassed && !this->CheckStopOnFailure()) { assert(this->Completed == this->Total); assert(this->Tests.empty()); } @@ -367,6 +367,11 @@ void cmCTestMultiProcessHandler::CheckResourcesAvailable() } } +bool cmCTestMultiProcessHandler::CheckStopOnFailure() +{ + return this->CTest->GetStopOnFailure(); +} + bool cmCTestMultiProcessHandler::CheckStopTimePassed() { if (!this->StopTimePassed) { @@ -483,6 +488,10 @@ void cmCTestMultiProcessHandler::StartNextTests() return; } + if (this->CheckStopOnFailure() && !this->Failed->empty()) { + return; + } + size_t numToStart = 0; if (this->RunningCount < this->ParallelLevel) { |