summaryrefslogtreecommitdiffstats
path: root/Source/cmAddTestCommand.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-01-12 15:58:54 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-01-14 10:03:07 (GMT)
commitf466cea3c9edffb1f524b64c514f8b7ef3913988 (patch)
treed6623a9efbd040dd7e6a091117fd642bc003b81c /Source/cmAddTestCommand.cxx
parent2d5e9f3d8cf44fafcd9a3b75ebce3d6fe383fe4e (diff)
downloadCMake-f466cea3c9edffb1f524b64c514f8b7ef3913988.zip
CMake-f466cea3c9edffb1f524b64c514f8b7ef3913988.tar.gz
CMake-f466cea3c9edffb1f524b64c514f8b7ef3913988.tar.bz2
cmMakefile: modernize memory management
Diffstat (limited to 'Source/cmAddTestCommand.cxx')
-rw-r--r--Source/cmAddTestCommand.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmAddTestCommand.cxx b/Source/cmAddTestCommand.cxx
index 8942113..205c1c7 100644
--- a/Source/cmAddTestCommand.cxx
+++ b/Source/cmAddTestCommand.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAddTestCommand.h"
+#include <cm/memory>
+
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
#include "cmStringAlgorithms.h"
@@ -44,7 +46,7 @@ bool cmAddTestCommand(std::vector<std::string> const& args,
} else {
test = mf.CreateTest(args[0]);
test->SetOldStyle(true);
- mf.AddTestGenerator(new cmTestGenerator(test));
+ mf.AddTestGenerator(cm::make_unique<cmTestGenerator>(test));
}
test->SetCommand(command);
@@ -141,7 +143,7 @@ bool cmAddTestCommandHandleNameMode(std::vector<std::string> const& args,
test->SetProperty("WORKING_DIRECTORY", working_directory.c_str());
}
test->SetCommandExpandLists(command_expand_lists);
- mf.AddTestGenerator(new cmTestGenerator(test, configurations));
+ mf.AddTestGenerator(cm::make_unique<cmTestGenerator>(test, configurations));
return true;
}