summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorMatthias Maennich <matthias@maennich.net>2017-09-21 21:06:05 (GMT)
committerMatthias Maennich <matthias@maennich.net>2017-09-25 22:07:19 (GMT)
commitf0489856e30b1b5236d1897071ea38dfde438fc7 (patch)
treef2a786e0c3fe5e9d234f62c3ca3cacfdbd70ef8f /Source/CTest
parenteae3765b67b653d3f00afa44a60719a387262af8 (diff)
downloadCMake-f0489856e30b1b5236d1897071ea38dfde438fc7.zip
CMake-f0489856e30b1b5236d1897071ea38dfde438fc7.tar.gz
CMake-f0489856e30b1b5236d1897071ea38dfde438fc7.tar.bz2
Retire std::auto_ptr and its macro CM_AUTO_PTR
Signed-off-by: Matthias Maennich <matthias@maennich.net>
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestLaunch.cxx8
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx10
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx19
3 files changed, 19 insertions, 18 deletions
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 453ae99..a1249f5 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -6,6 +6,7 @@
#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
#include <iostream>
+#include <memory> // IWYU pragma: keep
#include <stdlib.h>
#include <string.h>
@@ -17,7 +18,6 @@
#include "cmStateSnapshot.h"
#include "cmSystemTools.h"
#include "cmXMLWriter.h"
-#include "cm_auto_ptr.hxx"
#include "cmake.h"
#ifdef _WIN32
@@ -626,12 +626,12 @@ void cmCTestLaunch::LoadConfig()
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator gg(&cm);
- CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
+ cmMakefile mf(&gg, cm.GetCurrentSnapshot());
std::string fname = this->LogDir;
fname += "CTestLaunchConfig.cmake";
if (cmSystemTools::FileExists(fname.c_str()) &&
- mf->ReadListFile(fname.c_str())) {
- this->SourceDir = mf->GetSafeDefinition("CTEST_SOURCE_DIRECTORY");
+ mf.ReadListFile(fname.c_str())) {
+ this->SourceDir = mf.GetSafeDefinition("CTEST_SOURCE_DIRECTORY");
cmSystemTools::ConvertToUnixSlashes(this->SourceDir);
}
}
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 5896014..c7ed927 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -8,6 +8,7 @@
#include <functional>
#include <iomanip>
#include <iterator>
+#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
#include <stdio.h>
@@ -28,7 +29,6 @@
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
#include "cmXMLWriter.h"
-#include "cm_auto_ptr.hxx"
#include "cm_utf8.h"
#include "cmake.h"
#include "cmsys/FStream.hxx"
@@ -1636,9 +1636,9 @@ void cmCTestTestHandler::GetListOfTests()
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator gg(&cm);
- CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
- mf->AddDefinition("CTEST_CONFIGURATION_TYPE",
- this->CTest->GetConfigType().c_str());
+ cmMakefile mf(&gg, cm.GetCurrentSnapshot());
+ mf.AddDefinition("CTEST_CONFIGURATION_TYPE",
+ this->CTest->GetConfigType().c_str());
// Add handler for ADD_TEST
cmCTestAddTestCommand* newCom1 = new cmCTestAddTestCommand;
@@ -1678,7 +1678,7 @@ void cmCTestTestHandler::GetListOfTests()
return;
}
- if (!mf->ReadListFile(testFilename)) {
+ if (!mf.ReadListFile(testFilename)) {
return;
}
if (cmSystemTools::GetErrorOccuredFlag()) {
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 7173439..786ed5e 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestUpdateHandler.h"
+#include "cmAlgorithms.h"
#include "cmCLocaleEnvironmentScope.h"
#include "cmCTest.h"
#include "cmCTestBZR.h"
@@ -16,7 +17,7 @@
#include "cmVersion.h"
#include "cmXMLWriter.h"
-#include "cm_auto_ptr.hxx"
+#include <memory> // IWYU pragma: keep
#include <sstream>
static const char* cmCTestUpdateHandlerUpdateStrings[] = {
@@ -134,28 +135,28 @@ int cmCTestUpdateHandler::ProcessHandler()
, this->Quiet);
// Create an object to interact with the VCS tool.
- CM_AUTO_PTR<cmCTestVC> vc;
+ std::unique_ptr<cmCTestVC> vc;
switch (this->UpdateType) {
case e_CVS:
- vc.reset(new cmCTestCVS(this->CTest, ofs));
+ vc = cm::make_unique<cmCTestCVS>(this->CTest, ofs);
break;
case e_SVN:
- vc.reset(new cmCTestSVN(this->CTest, ofs));
+ vc = cm::make_unique<cmCTestSVN>(this->CTest, ofs);
break;
case e_BZR:
- vc.reset(new cmCTestBZR(this->CTest, ofs));
+ vc = cm::make_unique<cmCTestBZR>(this->CTest, ofs);
break;
case e_GIT:
- vc.reset(new cmCTestGIT(this->CTest, ofs));
+ vc = cm::make_unique<cmCTestGIT>(this->CTest, ofs);
break;
case e_HG:
- vc.reset(new cmCTestHG(this->CTest, ofs));
+ vc = cm::make_unique<cmCTestHG>(this->CTest, ofs);
break;
case e_P4:
- vc.reset(new cmCTestP4(this->CTest, ofs));
+ vc = cm::make_unique<cmCTestP4>(this->CTest, ofs);
break;
default:
- vc.reset(new cmCTestVC(this->CTest, ofs));
+ vc = cm::make_unique<cmCTestVC>(this->CTest, ofs);
break;
}
vc->SetCommandLineTool(this->UpdateCommand);