summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-12-09 16:39:29 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-12-17 09:44:02 (GMT)
commitf7d12609f038a0e4e09f9a40fa081c4a4db3e56b (patch)
treec20d476dfb30aa3772797b2d66d27bbedd1ce662 /Source/CTest
parenta38d04c0764b3550bd7d17b659945a38c1368f1e (diff)
downloadCMake-f7d12609f038a0e4e09f9a40fa081c4a4db3e56b.zip
CMake-f7d12609f038a0e4e09f9a40fa081c4a4db3e56b.tar.gz
CMake-f7d12609f038a0e4e09f9a40fa081c4a4db3e56b.tar.bz2
Refactoring: use append functions from cmext/algorithm
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBZR.cxx5
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx5
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx13
-rw-r--r--Source/CTest/cmCTestCurl.cxx7
-rw-r--r--Source/CTest/cmCTestHG.cxx5
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx6
-rw-r--r--Source/CTest/cmCTestP4.cxx5
-rw-r--r--Source/CTest/cmCTestSVN.cxx7
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx16
-rw-r--r--Source/CTest/cmProcess.cxx5
10 files changed, 43 insertions, 31 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 8640c46..c87fb83b 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -8,11 +8,12 @@
#include <ostream>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
#include "cm_expat.h"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -245,7 +246,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CData, data, data + length);
+ cm::append(this->CData, data, data + length);
}
void EndElement(const std::string& name) override
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 9cb5449..03a3fd3 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -7,11 +7,12 @@
#include <set>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/Directory.hxx"
#include "cmsys/FStream.hxx"
#include "cmsys/Process.h"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmDuration.h"
#include "cmFileTimeCache.h"
@@ -969,7 +970,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
if (it != queue->end()) {
// Create a contiguous array for the line
this->CurrentProcessingLine.clear();
- cmAppend(this->CurrentProcessingLine, queue->begin(), it);
+ cm::append(this->CurrentProcessingLine, queue->begin(), it);
this->CurrentProcessingLine.push_back(0);
const char* line = this->CurrentProcessingLine.data();
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 4cd783f..2c8f119 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -12,12 +12,13 @@
#include <sstream>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
#include "cmsys/Process.h"
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
@@ -819,7 +820,7 @@ int cmCTestCoverageHandler::HandleJacocoCoverage(
std::string binaryDir = this->CTest->GetCTestConfiguration("BuildDirectory");
std::string binCoverageFile = binaryDir + "/*jacoco.xml";
g2.FindFiles(binCoverageFile);
- cmAppend(files, g2.GetFiles());
+ cm::append(files, g2.GetFiles());
if (!files.empty()) {
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -1462,7 +1463,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
" looking for LCOV files in: " << daGlob << std::endl, this->Quiet);
gl.FindFiles(daGlob);
// Keep a list of all LCOV files
- cmAppend(lcovFiles, gl.GetFiles());
+ cm::append(lcovFiles, gl.GetFiles());
for (std::string const& file : lcovFiles) {
lcovFile = file;
@@ -1599,10 +1600,10 @@ void cmCTestCoverageHandler::FindGCovFiles(std::vector<std::string>& files)
" globbing for coverage in: " << lm.first << std::endl, this->Quiet);
std::string daGlob = cmStrCat(lm.first, "/*.da");
gl.FindFiles(daGlob);
- cmAppend(files, gl.GetFiles());
+ cm::append(files, gl.GetFiles());
daGlob = cmStrCat(lm.first, "/*.gcda");
gl.FindFiles(daGlob);
- cmAppend(files, gl.GetFiles());
+ cm::append(files, gl.GetFiles());
}
}
@@ -1638,7 +1639,7 @@ bool cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
"Error while finding files matching " << daGlob << std::endl);
return false;
}
- cmAppend(files, gl.GetFiles());
+ cm::append(files, gl.GetFiles());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Now searching in: " << daGlob << std::endl, this->Quiet);
return true;
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx
index ccac832..3ad4749 100644
--- a/Source/CTest/cmCTestCurl.cxx
+++ b/Source/CTest/cmCTestCurl.cxx
@@ -5,7 +5,8 @@
#include <cstdio>
#include <ostream>
-#include "cmAlgorithms.h"
+#include <cmext/algorithm>
+
#include "cmCTest.h"
#include "cmCurl.h"
#include "cmStringAlgorithms.h"
@@ -46,14 +47,14 @@ size_t curlWriteMemoryCallback(void* ptr, size_t size, size_t nmemb,
{
int realsize = static_cast<int>(size * nmemb);
const char* chPtr = static_cast<char*>(ptr);
- cmAppend(*static_cast<std::vector<char>*>(data), chPtr, chPtr + realsize);
+ cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + realsize);
return realsize;
}
size_t curlDebugCallback(CURL* /*unused*/, curl_infotype /*unused*/,
char* chPtr, size_t size, void* data)
{
- cmAppend(*static_cast<std::vector<char>*>(data), chPtr, chPtr + size);
+ cm::append(*static_cast<std::vector<char>*>(data), chPtr, chPtr + size);
return size;
}
}
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 3265498..5f4581e 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -5,9 +5,10 @@
#include <ostream>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -204,7 +205,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CData, data, data + length);
+ cm::append(this->CData, data, data + length);
}
void EndElement(const std::string& name) override
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 04abf98..37679b9 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -19,6 +19,8 @@
#include <utility>
#include <vector>
+#include <cmext/algorithm>
+
#include "cmsys/FStream.hxx"
#include "cmsys/SystemInformation.hxx"
@@ -788,7 +790,7 @@ void cmCTestMultiProcessHandler::CreateParallelTestCostList()
// Sort tests within each level by COST and append them to the cost list.
for (TestSet const& currentSet : cmReverseRange(priorityStack)) {
TestList sortedCopy;
- cmAppend(sortedCopy, currentSet);
+ cm::append(sortedCopy, currentSet);
std::stable_sort(sortedCopy.begin(), sortedCopy.end(),
TestComparator(this));
@@ -1154,7 +1156,7 @@ static Json::Value DumpCTestInfo(
const std::vector<std::string>& args = testRun.GetArguments();
if (!args.empty()) {
commandAndArgs.reserve(args.size() + 1);
- cmAppend(commandAndArgs, args);
+ cm::append(commandAndArgs, args);
}
testInfo["command"] = DumpToJsonArray(commandAndArgs);
}
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index e2063e1..1375be4 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -7,9 +7,10 @@
#include <ostream>
#include <utility>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -326,7 +327,7 @@ void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
// The CTEST_P4_OPTIONS variable adds additional Perforce command line
// options before the main command
std::string opts = this->CTest->GetCTestConfiguration("P4Options");
- cmAppend(P4Options, cmSystemTools::ParseArguments(opts));
+ cm::append(P4Options, cmSystemTools::ParseArguments(opts));
}
CommandOptions.clear();
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 34395c9..44dfab2 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -7,9 +7,10 @@
#include <map>
#include <ostream>
+#include <cmext/algorithm>
+
#include "cmsys/RegularExpression.hxx"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestVC.h"
#include "cmProcessTools.h"
@@ -271,7 +272,7 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
std::vector<char const*> args;
args.push_back(this->CommandLineTool.c_str());
- cmAppend(args, parameters);
+ cm::append(args, parameters);
args.push_back("--non-interactive");
std::string userOptions = this->CTest->GetCTestConfiguration("SVNOptions");
@@ -344,7 +345,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CData, data, data + length);
+ cm::append(this->CData, data, data + length);
}
void EndElement(const std::string& name) override
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 2ac5af6..a8f201a 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -7,6 +7,8 @@
#include <cstdlib>
#include <sstream>
+#include <cmext/algorithm>
+
#include "cm_curl.h"
#include "cm_jsoncpp_reader.h"
#include "cm_jsoncpp_value.h"
@@ -65,7 +67,7 @@ private:
void CharacterDataHandler(const char* data, int length) override
{
- cmAppend(this->CurrentValue, data, data + length);
+ cm::append(this->CurrentValue, data, data + length);
}
void EndElement(const std::string& name) override
@@ -96,8 +98,8 @@ static size_t cmCTestSubmitHandlerWriteMemoryCallback(void* ptr, size_t size,
{
int realsize = static_cast<int>(size * nmemb);
const char* chPtr = static_cast<char*>(ptr);
- cmAppend(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
- chPtr + realsize);
+ cm::append(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
+ chPtr + realsize);
return realsize;
}
@@ -106,8 +108,8 @@ static size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/,
char* chPtr, size_t size,
void* data)
{
- cmAppend(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
- chPtr + size);
+ cm::append(*static_cast<cmCTestSubmitHandlerVectorOfChar*>(data), chPtr,
+ chPtr + size);
return size;
}
@@ -768,7 +770,7 @@ int cmCTestSubmitHandler::ProcessHandler()
if (!this->Files.empty()) {
// Submit the explicitly selected files:
- cmAppend(files, this->Files);
+ cm::append(files, this->Files);
}
// Add to the list of files to submit from any selected, existing parts:
@@ -814,7 +816,7 @@ int cmCTestSubmitHandler::ProcessHandler()
}
// Submit files from this part.
- cmAppend(files, this->CTest->GetSubmitFiles(p));
+ cm::append(files, this->CTest->GetSubmitFiles(p));
}
// Make sure files are unique, but preserve order.
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 87f7147..2ec9622 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -6,9 +6,10 @@
#include <iostream>
#include <string>
+#include <cmext/algorithm>
+
#include "cmsys/Process.h"
-#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestRunTest.h"
#include "cmCTestTestHandler.h"
@@ -218,7 +219,7 @@ void cmProcess::OnRead(ssize_t nread, const uv_buf_t* buf)
if (nread > 0) {
std::string strdata;
this->Conv.DecodeText(buf->base, static_cast<size_t>(nread), strdata);
- cmAppend(this->Output, strdata);
+ cm::append(this->Output, strdata);
while (this->Output.GetLine(line)) {
this->Runner.CheckOutput(line);