summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx9
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx16
-rw-r--r--Source/CTest/cmCTestGIT.cxx2
-rw-r--r--Source/CTest/cmCTestLaunch.cxx4
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx4
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx5
-rw-r--r--Source/CTest/cmCTestRunTest.cxx10
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx4
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx4
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx14
-rw-r--r--Source/CTest/cmCTestVC.cxx2
12 files changed, 40 insertions, 36 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 8527d54..a8309d9 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -83,6 +83,7 @@ static const char* cmCTestErrorExceptions[] = {
"instantiated from ",
"candidates are:",
": warning",
+ ": WARNING",
": \\(Warning\\)",
": note",
"Note:",
@@ -326,7 +327,7 @@ int cmCTestBuildHandler::ProcessHandler()
std::string const& useLaunchers =
this->CTest->GetCTestConfiguration("UseLaunchers");
- this->UseCTestLaunch = cmSystemTools::IsOn(useLaunchers.c_str());
+ this->UseCTestLaunch = cmSystemTools::IsOn(useLaunchers);
// Create a last build log
cmGeneratedFileStream ofs;
@@ -589,7 +590,7 @@ void cmCTestBuildHandler::GenerateXMLLogScraped(cmXMLWriter& xml)
for (cmCTestCompileErrorWarningRex& rit :
this->ErrorWarningFileLineRegex) {
cmsys::RegularExpression* re = &rit.RegularExpression;
- if (re->find(cm->Text.c_str())) {
+ if (re->find(cm->Text)) {
cm->SourceFile = re->match(rit.FileIndex);
// At this point we need to make this->SourceFile relative to
// the source root of the project, so cvs links will work
@@ -742,7 +743,7 @@ void cmCTestBuildHandler::LaunchHelper::WriteLauncherConfig()
// Give some testing configuration information to the launcher.
std::string fname = this->Handler->CTestLaunchDir;
fname += "/CTestLaunchConfig.cmake";
- cmGeneratedFileStream fout(fname.c_str());
+ cmGeneratedFileStream fout(fname);
std::string srcdir = this->CTest->GetCTestConfiguration("SourceDirectory");
fout << "set(CTEST_SOURCE_DIRECTORY \"" << srcdir << "\")\n";
}
@@ -757,7 +758,7 @@ void cmCTestBuildHandler::LaunchHelper::WriteScrapeMatchers(
fname += "/Custom";
fname += purpose;
fname += ".txt";
- cmGeneratedFileStream fout(fname.c_str());
+ cmGeneratedFileStream fout(fname);
for (std::string const& m : matchers) {
fout << m << "\n";
}
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 43a2bae..1d9a5f7 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -1075,7 +1075,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
if (line.empty()) {
// Ignore empty line; probably style 2
- } else if (st1re1.find(line.c_str())) {
+ } else if (st1re1.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 1;
}
@@ -1088,7 +1088,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
actualSourceFile.clear();
sourceFile = st1re1.match(2);
- } else if (st1re2.find(line.c_str())) {
+ } else if (st1re2.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 1;
}
@@ -1100,7 +1100,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
}
gcovFile = st1re2.match(1);
- } else if (st2re1.find(line.c_str())) {
+ } else if (st2re1.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 2;
}
@@ -1113,7 +1113,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
actualSourceFile.clear();
sourceFile = st2re1.match(1);
- } else if (st2re2.find(line.c_str())) {
+ } else if (st2re2.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 2;
}
@@ -1123,7 +1123,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
cont->Error++;
break;
}
- } else if (st2re3.find(line.c_str())) {
+ } else if (st2re3.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 2;
}
@@ -1135,7 +1135,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
}
gcovFile = st2re3.match(2);
- } else if (st2re4.find(line.c_str())) {
+ } else if (st2re4.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 2;
}
@@ -1150,7 +1150,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
"Warning: " << st2re4.match(1)
<< " had unexpected EOF" << std::endl,
this->Quiet);
- } else if (st2re5.find(line.c_str())) {
+ } else if (st2re5.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 2;
}
@@ -1165,7 +1165,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
"Warning: Cannot open file: " << st2re5.match(1)
<< std::endl,
this->Quiet);
- } else if (st2re6.find(line.c_str())) {
+ } else if (st2re6.find(line)) {
if (gcovStyle == 0) {
gcovStyle = 2;
}
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index b919c79..71fcafb 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -272,7 +272,7 @@ bool cmCTestGIT::UpdateImpl()
std::string init_submodules =
this->CTest->GetCTestConfiguration("GITInitSubmodules");
- if (cmSystemTools::IsOn(init_submodules.c_str())) {
+ if (cmSystemTools::IsOn(init_submodules)) {
char const* git_submodule_init[] = { git, "submodule", "init", nullptr };
ret = this->RunChild(git_submodule_init, &submodule_out, &submodule_err,
top_dir.c_str());
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 0bffde3..6cd1c09 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -345,7 +345,7 @@ void cmCTestLaunch::WriteXML()
logXML += ".xml";
// Use cmGeneratedFileStream to atomically create the report file.
- cmGeneratedFileStream fxml(logXML.c_str());
+ cmGeneratedFileStream fxml(logXML);
cmXMLWriter xml(fxml, 2);
cmXMLElement e2(xml, "Failure");
e2.Attribute("type", this->IsError() ? "Error" : "Warning");
@@ -584,7 +584,7 @@ bool cmCTestLaunch::Match(std::string const& line,
std::vector<cmsys::RegularExpression>& regexps)
{
for (cmsys::RegularExpression& r : regexps) {
- if (r.find(line.c_str())) {
+ if (r.find(line)) {
return true;
}
}
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 04d1839..9c9532a 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -1087,7 +1087,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(
g.FindFiles(ofile);
if (g.GetFiles().empty()) {
std::string log = "Cannot find memory tester output file: " + ofile;
- cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
+ cmCTestLog(this->CTest, WARNING, log << std::endl);
ofile.clear();
} else {
files = g.GetFiles();
@@ -1095,7 +1095,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(
}
} else if (!cmSystemTools::FileExists(ofile)) {
std::string log = "Cannot find memory tester output file: " + ofile;
- cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl);
+ cmCTestLog(this->CTest, WARNING, log << std::endl);
ofile.clear();
}
files.push_back(std::move(ofile));
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 322da23..54b4be2 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -14,7 +14,6 @@
#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
#include "cmsys/FStream.hxx"
-#include "cmsys/String.hxx"
#include "cmsys/SystemInformation.hxx"
#include <algorithm>
@@ -477,7 +476,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
if (line == "---") {
break;
}
- std::vector<cmsys::String> parts = cmSystemTools::SplitString(line, ' ');
+ std::vector<std::string> parts = cmSystemTools::SplitString(line, ' ');
// Format: <name> <previous_runs> <avg_cost>
if (parts.size() < 3) {
break;
@@ -530,7 +529,7 @@ void cmCTestMultiProcessHandler::ReadCostData()
break;
}
- std::vector<cmsys::String> parts = cmSystemTools::SplitString(line, ' ');
+ std::vector<std::string> parts = cmSystemTools::SplitString(line, ' ');
// Probably an older version of the file, will be fixed next run
if (parts.size() < 3) {
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 927797a..ef0a49d 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -49,7 +49,7 @@ void cmCTestRunTest::CheckOutput(std::string const& line)
// Check for TIMEOUT_AFTER_MATCH property.
if (!this->TestProperties->TimeoutRegularExpressions.empty()) {
for (auto& reg : this->TestProperties->TimeoutRegularExpressions) {
- if (reg.first.find(this->ProcessOutput.c_str())) {
+ if (reg.first.find(this->ProcessOutput)) {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
this->GetIndex()
<< ": "
@@ -148,7 +148,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
this->FailedDependencies.empty()) {
bool found = false;
for (auto& pass : this->TestProperties->RequiredRegularExpressions) {
- if (pass.first.find(this->ProcessOutput.c_str())) {
+ if (pass.first.find(this->ProcessOutput)) {
found = true;
reason = "Required regular expression found.";
break;
@@ -168,7 +168,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
if (!this->TestProperties->ErrorRegularExpressions.empty() &&
this->FailedDependencies.empty()) {
for (auto& pass : this->TestProperties->ErrorRegularExpressions) {
- if (pass.first.find(this->ProcessOutput.c_str())) {
+ if (pass.first.find(this->ProcessOutput)) {
reason = "Error regular expression found in output.";
reason += " Regex=[";
reason += pass.second;
@@ -616,10 +616,10 @@ void cmCTestRunTest::DartProcessing()
{
if (!this->ProcessOutput.empty() &&
this->ProcessOutput.find("<DartMeasurement") != std::string::npos) {
- if (this->TestHandler->DartStuff.find(this->ProcessOutput.c_str())) {
+ if (this->TestHandler->DartStuff.find(this->ProcessOutput)) {
this->TestResult.DartString = this->TestHandler->DartStuff.match(1);
// keep searching and replacing until none are left
- while (this->TestHandler->DartStuff1.find(this->ProcessOutput.c_str())) {
+ while (this->TestHandler->DartStuff1.find(this->ProcessOutput)) {
// replace the exact match for the string
cmSystemTools::ReplaceString(
this->ProcessOutput, this->TestHandler->DartStuff1.match(1).c_str(),
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 333c899..6b62bb4 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -792,7 +792,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Write CMake output to file: " << cmakeOutputFile
<< std::endl);
- cmGeneratedFileStream fout(cmakeOutputFile.c_str());
+ cmGeneratedFileStream fout(cmakeOutputFile);
if (fout) {
fout << output.c_str();
} else {
@@ -856,7 +856,7 @@ bool cmCTestScriptHandler::WriteInitialCache(const char* directory,
{
std::string cacheFile = directory;
cacheFile += "/CMakeCache.txt";
- cmGeneratedFileStream fout(cacheFile.c_str());
+ cmGeneratedFileStream fout(cacheFile);
if (!fout) {
return false;
}
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index 3911540..47006c1 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -121,7 +121,7 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
// Log startup actions.
std::string startLogFile = binaryDir + "/Testing/Temporary/LastStart.log";
- cmGeneratedFileStream ofs(startLogFile.c_str());
+ cmGeneratedFileStream ofs(startLogFile);
if (!ofs) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot create log file: LastStart.log" << std::endl);
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 4c2b75e..cbed40e 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -454,6 +454,10 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
// specify target
::curl_easy_setopt(curl, CURLOPT_URL, upload_as.c_str());
+ // CURLAUTH_BASIC is default, and here we allow additional methods,
+ // including more secure ones
+ ::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
+
// now specify which file to upload
::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile);
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 91b92a3..7fb5e80 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2126,10 +2126,10 @@ bool cmCTestTestHandler::SetTestsProperties(
for (cmCTestTestProperties& rt : this->TestList) {
if (t == rt.Name) {
if (key == "WILL_FAIL") {
- rt.WillFail = cmSystemTools::IsOn(val.c_str());
+ rt.WillFail = cmSystemTools::IsOn(val);
}
if (key == "DISABLED") {
- rt.Disabled = cmSystemTools::IsOn(val.c_str());
+ rt.Disabled = cmSystemTools::IsOn(val);
}
if (key == "ATTACHED_FILES") {
cmSystemTools::ExpandListArgument(val, rt.AttachedFiles);
@@ -2172,7 +2172,7 @@ bool cmCTestTestHandler::SetTestsProperties(
cmSystemTools::ExpandListArgument(val, rt.RequiredFiles);
}
if (key == "RUN_SERIAL") {
- rt.RunSerial = cmSystemTools::IsOn(val.c_str());
+ rt.RunSerial = cmSystemTools::IsOn(val);
}
if (key == "FAIL_REGULAR_EXPRESSION") {
std::vector<std::string> lval;
@@ -2188,7 +2188,7 @@ bool cmCTestTestHandler::SetTestsProperties(
}
}
if (key == "PROCESSOR_AFFINITY") {
- rt.WantAffinity = cmSystemTools::IsOn(val.c_str());
+ rt.WantAffinity = cmSystemTools::IsOn(val);
}
if (key == "SKIP_RETURN_CODE") {
rt.SkipReturnCode = atoi(val.c_str());
@@ -2310,7 +2310,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
this->Quiet);
if (this->UseExcludeRegExpFlag && this->UseExcludeRegExpFirst &&
- this->ExcludeTestsRegularExpression.find(testname.c_str())) {
+ this->ExcludeTestsRegularExpression.find(testname)) {
return true;
}
if (this->MemCheck) {
@@ -2365,10 +2365,10 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
test.SkipReturnCode = -1;
test.PreviousRuns = 0;
if (this->UseIncludeRegExpFlag &&
- !this->IncludeTestsRegularExpression.find(testname.c_str())) {
+ !this->IncludeTestsRegularExpression.find(testname)) {
test.IsInBasedOnREOptions = false;
} else if (this->UseExcludeRegExpFlag && !this->UseExcludeRegExpFirst &&
- this->ExcludeTestsRegularExpression.find(testname.c_str())) {
+ this->ExcludeTestsRegularExpression.find(testname)) {
test.IsInBasedOnREOptions = false;
}
this->TestList.push_back(test);
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index a59d671..21c8889 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -146,7 +146,7 @@ bool cmCTestVC::Update()
// if update version only is on then do not actually update,
// just note the current version and finish
if (!cmSystemTools::IsOn(
- this->CTest->GetCTestConfiguration("UpdateVersionOnly").c_str())) {
+ this->CTest->GetCTestConfiguration("UpdateVersionOnly"))) {
result = this->NoteOldRevision() && result;
this->Log << "--- Begin Update ---\n";
result = this->UpdateImpl() && result;