diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2019-03-05 18:20:29 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2019-03-05 18:20:29 (GMT) |
commit | 1166aa5ce784a07ca2ce7d750f11ed174562bdc6 (patch) | |
tree | 35dd486d2f8a6ea1a8f023bde8f548a14eb0432b /Source/CTest/cmCTestRunTest.cxx | |
parent | 451d3907fdb0eea70f1107712324300d786433d7 (diff) | |
download | CMake-1166aa5ce784a07ca2ce7d750f11ed174562bdc6.zip CMake-1166aa5ce784a07ca2ce7d750f11ed174562bdc6.tar.gz CMake-1166aa5ce784a07ca2ce7d750f11ed174562bdc6.tar.bz2 |
ctest: refactor some code
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 41d02c5..3bf2087 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -432,32 +432,26 @@ bool cmCTestRunTest::StartTest(size_t completed, size_t total) this->ProcessOutput.clear(); + this->TestResult.Properties = this->TestProperties; + this->TestResult.ExecutionTime = cmDuration::zero(); + this->TestResult.CompressOutput = false; + this->TestResult.ReturnValue = -1; + this->TestResult.TestCount = this->TestProperties->Index; + this->TestResult.Name = this->TestProperties->Name; + this->TestResult.Path = this->TestProperties->Directory; + // Return immediately if test is disabled if (this->TestProperties->Disabled) { - this->TestResult.Properties = this->TestProperties; - this->TestResult.ExecutionTime = cmDuration::zero(); - this->TestResult.CompressOutput = false; - this->TestResult.ReturnValue = -1; this->TestResult.CompletionStatus = "Disabled"; this->TestResult.Status = cmCTestTestHandler::NOT_RUN; - this->TestResult.TestCount = this->TestProperties->Index; - this->TestResult.Name = this->TestProperties->Name; - this->TestResult.Path = this->TestProperties->Directory; this->TestProcess = cm::make_unique<cmProcess>(*this); this->TestResult.Output = "Disabled"; this->TestResult.FullCommandLine.clear(); return false; } - this->TestResult.Properties = this->TestProperties; - this->TestResult.ExecutionTime = cmDuration::zero(); - this->TestResult.CompressOutput = false; - this->TestResult.ReturnValue = -1; this->TestResult.CompletionStatus = "Failed to start"; this->TestResult.Status = cmCTestTestHandler::BAD_COMMAND; - this->TestResult.TestCount = this->TestProperties->Index; - this->TestResult.Name = this->TestProperties->Name; - this->TestResult.Path = this->TestProperties->Directory; // Check for failed fixture dependencies before we even look at the command // arguments because if we are not going to run the test, the command and @@ -635,9 +629,8 @@ bool cmCTestRunTest::ForkProcess(cmDuration testTimeOut, bool explicitTimeout, { this->TestProcess = cm::make_unique<cmProcess>(*this); this->TestProcess->SetId(this->Index); - this->TestProcess->SetWorkingDirectory( - this->TestProperties->Directory.c_str()); - this->TestProcess->SetCommand(this->ActualCommand.c_str()); + this->TestProcess->SetWorkingDirectory(this->TestProperties->Directory); + this->TestProcess->SetCommand(this->ActualCommand); this->TestProcess->SetCommandArguments(this->Arguments); // determine how much time we have |