summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmProcess.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-03-10 15:04:51 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-03-11 16:46:11 (GMT)
commitf964739ead050d9c3ecdedb5ae717b0af2a2886f (patch)
tree1bad5594aba385c10ba53f99310d55053211475d /Source/CTest/cmProcess.h
parente3571773ce581193414b0d926c511dae159f0920 (diff)
downloadCMake-f964739ead050d9c3ecdedb5ae717b0af2a2886f.zip
CMake-f964739ead050d9c3ecdedb5ae717b0af2a2886f.tar.gz
CMake-f964739ead050d9c3ecdedb5ae717b0af2a2886f.tar.bz2
cmCTestRunTest: modernize memory management
Diffstat (limited to 'Source/CTest/cmProcess.h')
-rw-r--r--Source/CTest/cmProcess.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h
index 2c24f2d..0f69f68 100644
--- a/Source/CTest/cmProcess.h
+++ b/Source/CTest/cmProcess.h
@@ -6,7 +6,9 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <chrono>
+#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include <stddef.h>
@@ -28,7 +30,7 @@ class cmCTestRunTest;
class cmProcess
{
public:
- explicit cmProcess(cmCTestRunTest& runner);
+ explicit cmProcess(std::unique_ptr<cmCTestRunTest> runner);
~cmProcess();
void SetCommand(std::string const& command);
void SetCommandArguments(std::vector<std::string> const& arg);
@@ -70,6 +72,11 @@ public:
Exception GetExitException();
std::string GetExitExceptionString();
+ std::unique_ptr<cmCTestRunTest> GetRunner()
+ {
+ return std::move(this->Runner);
+ }
+
private:
cmDuration Timeout;
std::chrono::steady_clock::time_point StartTime;
@@ -82,7 +89,7 @@ private:
cm::uv_timer_ptr Timer;
std::vector<char> Buf;
- cmCTestRunTest& Runner;
+ std::unique_ptr<cmCTestRunTest> Runner;
cmProcessOutput Conv;
int Signal = 0;
cmProcess::State ProcessState = cmProcess::State::Starting;