cmCTestMultiProcessHandler: Factor out loop startup and teardown

This commit is contained in:
Brad King
2023-11-21 12:37:31 -05:00
parent 5ff0b4ed57
commit 61e98ca33b
2 changed files with 15 additions and 2 deletions
+12 -2
View File
@@ -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());
@@ -148,6 +148,9 @@ protected:
bool CheckStopTimePassed();
void SetStopTimePassed();
void InitializeLoop();
void FinalizeLoop();
void LockResources(int index);
void UnlockResources(int index);