[Cmake-commits] CMake branch, master, updated. v3.14.0-rc3-313-g2992ba2

Kitware Robot kwrobot at kitware.com
Thu Mar 7 09:53:02 EST 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  2992ba2d02c1cdfe1ea181e3d560087126c700a1 (commit)
       via  1166aa5ce784a07ca2ce7d750f11ed174562bdc6 (commit)
      from  3a5ccabd15ac535d73cd8d129974dea9d670b58a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2992ba2d02c1cdfe1ea181e3d560087126c700a1
commit 2992ba2d02c1cdfe1ea181e3d560087126c700a1
Merge: 3a5ccab 1166aa5
Author:     Kyle Edwards <kyle.edwards at kitware.com>
AuthorDate: Thu Mar 7 14:45:56 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Mar 7 09:46:03 2019 -0500

    Merge topic 'feature/cleanup-ctest'
    
    1166aa5ce7 ctest: refactor some code
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3064


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1166aa5ce784a07ca2ce7d750f11ed174562bdc6
commit 1166aa5ce784a07ca2ce7d750f11ed174562bdc6
Author:     Gregor Jasny <gjasny at googlemail.com>
AuthorDate: Tue Mar 5 19:20:29 2019 +0100
Commit:     Gregor Jasny <gjasny at googlemail.com>
CommitDate: Tue Mar 5 19:20:29 2019 +0100

    ctest: refactor some code

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
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index cd2e2f7..bfe8d70 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -73,7 +73,7 @@ cmProcess::cmProcess(cmCTestRunTest& runner)
 
 cmProcess::~cmProcess() = default;
 
-void cmProcess::SetCommand(const char* command)
+void cmProcess::SetCommand(std::string const& command)
 {
   this->Command = command;
 }
@@ -83,6 +83,11 @@ void cmProcess::SetCommandArguments(std::vector<std::string> const& args)
   this->Arguments = args;
 }
 
+void cmProcess::SetWorkingDirectory(std::string const& dir)
+{
+  this->WorkingDirectory = dir;
+}
+
 bool cmProcess::StartProcess(uv_loop_t& loop, std::vector<size_t>* affinity)
 {
   this->ProcessState = cmProcess::State::Error;
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index e5ca17f..a0a4b6b 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -28,10 +28,9 @@ class cmProcess
 public:
   explicit cmProcess(cmCTestRunTest& runner);
   ~cmProcess();
-  const char* GetCommand() { return this->Command.c_str(); }
-  void SetCommand(const char* command);
+  void SetCommand(std::string const& command);
   void SetCommandArguments(std::vector<std::string> const& arg);
-  void SetWorkingDirectory(const char* dir) { this->WorkingDirectory = dir; }
+  void SetWorkingDirectory(std::string const& dir);
   void SetTimeout(cmDuration t) { this->Timeout = t; }
   void ChangeTimeout(cmDuration t);
   void ResetStartTime();

-----------------------------------------------------------------------

Summary of changes:
 Source/CTest/cmCTestRunTest.cxx | 27 ++++++++++-----------------
 Source/CTest/cmProcess.cxx      |  7 ++++++-
 Source/CTest/cmProcess.h        |  5 ++---
 3 files changed, 18 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list