summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-11-21 01:23:38 (GMT)
committerBrad King <brad.king@kitware.com>2023-11-21 17:37:31 (GMT)
commit61e98ca33baf3fa6762e5e44286fb93b2a4a173c (patch)
treebf1c3e66b97857c63fd5a69b906326092b178a8e /Source/CTest
parent5ff0b4ed57e4ccea77e78e128765e3ecc7e86f50 (diff)
downloadCMake-61e98ca33baf3fa6762e5e44286fb93b2a4a173c.zip
CMake-61e98ca33baf3fa6762e5e44286fb93b2a4a173c.tar.gz
CMake-61e98ca33baf3fa6762e5e44286fb93b2a4a173c.tar.bz2
cmCTestMultiProcessHandler: Factor out loop startup and teardown
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx14
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index d97148d..5c3e999 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -125,6 +125,16 @@ bool cmCTestMultiProcessHandler::Complete()
return this->Completed == this->Total;
}
+void cmCTestMultiProcessHandler::InitializeLoop()
+{
+ this->Loop.init();
+}
+
+void cmCTestMultiProcessHandler::FinalizeLoop()
+{
+ this->Loop.reset();
+}
+
void cmCTestMultiProcessHandler::RunTests()
{
this->CheckResume();
@@ -133,10 +143,10 @@ void cmCTestMultiProcessHandler::RunTests()
}
this->TestHandler->SetMaxIndex(this->FindMaxIndex());
- this->Loop.init();
+ this->InitializeLoop();
this->StartNextTests();
uv_run(this->Loop, UV_RUN_DEFAULT);
- this->Loop.reset();
+ this->FinalizeLoop();
if (!this->StopTimePassed && !this->CheckStopOnFailure()) {
assert(this->Complete());
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 6832786..d51a33a 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -148,6 +148,9 @@ protected:
bool CheckStopTimePassed();
void SetStopTimePassed();
+ void InitializeLoop();
+ void FinalizeLoop();
+
void LockResources(int index);
void UnlockResources(int index);