diff options
author | Brad King <brad.king@kitware.com> | 2023-05-04 19:21:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-04 20:58:43 (GMT) |
commit | 59336b29bd713c288423d8330c74b74cfc0eaf58 (patch) | |
tree | e9ca4de317a910228065308154f77286568513e1 /Source | |
parent | 07b5087ba7ac3f55ee0f739717306a028d4244e1 (diff) | |
download | CMake-59336b29bd713c288423d8330c74b74cfc0eaf58.zip CMake-59336b29bd713c288423d8330c74b74cfc0eaf58.tar.gz CMake-59336b29bd713c288423d8330c74b74cfc0eaf58.tar.bz2 |
cmCTestRunTest: Remove unnecessary arguments to ForkProcess
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 24 | ||||
-rw-r--r-- | 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<std::string>* environment, - std::vector<std::string>* environment_modification, - std::vector<size_t>* 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<std::string>* 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<std::string>* environment, - std::vector<std::string>* environment_modification, - std::vector<size_t>* affinity); + bool ForkProcess(cmDuration testTimeOut); void WriteLogOutputTop(size_t completed, size_t total); // Run post processing of the process output for MemCheck void MemCheckPostProcess(); |