From 59336b29bd713c288423d8330c74b74cfc0eaf58 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 4 May 2023 15:21:02 -0400 Subject: cmCTestRunTest: Remove unnecessary arguments to ForkProcess --- Source/CTest/cmCTestRunTest.cxx | 24 +++++++++--------------- Source/CTest/cmCTestRunTest.h | 5 +---- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 23f437a..307312d 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -636,10 +636,7 @@ bool cmCTestRunTest::StartTest(size_t completed, size_t total) } } - return this->ForkProcess(timeout, this->TestProperties->ExplicitTimeout, - &this->TestProperties->Environment, - &this->TestProperties->EnvironmentModification, - &this->TestProperties->Affinity); + return this->ForkProcess(timeout); } void cmCTestRunTest::ComputeArguments() @@ -737,11 +734,7 @@ void cmCTestRunTest::ParseOutputForMeasurements() } } -bool cmCTestRunTest::ForkProcess( - cmDuration testTimeOut, bool explicitTimeout, - std::vector* environment, - std::vector* environment_modification, - std::vector* affinity) +bool cmCTestRunTest::ForkProcess(cmDuration testTimeOut) { this->TestProcess->SetId(this->Index); this->TestProcess->SetWorkingDirectory(this->TestProperties->Directory); @@ -766,7 +759,8 @@ bool cmCTestRunTest::ForkProcess( timeout = std::chrono::seconds(1); } // handle timeout explicitly set to 0 - if (testTimeOut == cmDuration::zero() && explicitTimeout) { + if (testTimeOut == cmDuration::zero() && + this->TestProperties->ExplicitTimeout) { timeout = cmDuration::zero(); } cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, @@ -784,17 +778,17 @@ bool cmCTestRunTest::ForkProcess( // We split processing ENVIRONMENT and ENVIRONMENT_MODIFICATION into two // phases to ensure that MYVAR=reset: in the latter phase resets to the // former phase's settings, rather than to the original environment. - if (environment && !environment->empty()) { + if (!this->TestProperties->Environment.empty()) { cmSystemTools::EnvDiff diff; - diff.AppendEnv(*environment); + diff.AppendEnv(this->TestProperties->Environment); diff.ApplyToCurrentEnv(&envMeasurement); } - if (environment_modification && !environment_modification->empty()) { + if (!this->TestProperties->EnvironmentModification.empty()) { cmSystemTools::EnvDiff diff; bool env_ok = true; - for (auto const& envmod : *environment_modification) { + for (auto const& envmod : this->TestProperties->EnvironmentModification) { env_ok &= diff.ParseOperation(envmod); } @@ -823,7 +817,7 @@ bool cmCTestRunTest::ForkProcess( 1); return this->TestProcess->StartProcess(this->MultiTestHandler.Loop, - affinity); + &this->TestProperties->Affinity); } void cmCTestRunTest::SetupResourcesEnvironment(std::vector* log) diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 7a97fa9..b2f4377 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -110,10 +110,7 @@ private: bool NeedsToRepeat(); void ParseOutputForMeasurements(); void ExeNotFound(std::string exe); - bool ForkProcess(cmDuration testTimeOut, bool explicitTimeout, - std::vector* environment, - std::vector* environment_modification, - std::vector* affinity); + bool ForkProcess(cmDuration testTimeOut); void WriteLogOutputTop(size_t completed, size_t total); // Run post processing of the process output for MemCheck void MemCheckPostProcess(); -- cgit v0.12