summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-08-01 19:00:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-09-02 11:27:32 (GMT)
commit11425041f04fd0945480b8f9e9933d1549b93981 (patch)
tree9cafffd6774513f686440b31795cbb3b5e38b65c /Source/CTest
parent99b21e58e020fedc6d09a619c1a8dc2e9ea7e2c5 (diff)
downloadCMake-11425041f04fd0945480b8f9e9933d1549b93981.zip
CMake-11425041f04fd0945480b8f9e9933d1549b93981.tar.gz
CMake-11425041f04fd0945480b8f9e9933d1549b93981.tar.bz2
cmMakefile::GetDefinition: return cmProp
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx55
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx10
-rw-r--r--Source/CTest/cmCTestConfigureCommand.cxx18
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx5
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx17
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx29
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx11
-rw-r--r--Source/CTest/cmCTestTestCommand.cxx17
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx5
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx3
10 files changed, 90 insertions, 80 deletions
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 8aab167..1cc267e 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestBuildCommand.h"
-#include <cstring>
#include <sstream>
#include <cmext/string_view>
@@ -39,12 +38,13 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
this->Handler = handler;
- cmProp ctestBuildCommand = this->Makefile->GetDef("CTEST_BUILD_COMMAND");
+ cmProp ctestBuildCommand =
+ this->Makefile->GetDefinition("CTEST_BUILD_COMMAND");
if (cmNonempty(ctestBuildCommand)) {
this->CTest->SetCTestConfiguration("MakeCommand", *ctestBuildCommand,
this->Quiet);
} else {
- const char* cmakeGeneratorName =
+ cmProp cmakeGeneratorName =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR");
// Build configuration is determined by: CONFIGURATION argument,
@@ -52,49 +52,51 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
// CTEST_CONFIGURATION_TYPE script variable, or ctest -C command
// line argument... in that order.
//
- const char* ctestBuildConfiguration =
+ cmProp ctestBuildConfiguration =
this->Makefile->GetDefinition("CTEST_BUILD_CONFIGURATION");
- const char* cmakeBuildConfiguration = !this->Configuration.empty()
- ? this->Configuration.c_str()
- : (cmNonempty(ctestBuildConfiguration)
- ? ctestBuildConfiguration
- : this->CTest->GetConfigType().c_str());
-
- const char* cmakeBuildAdditionalFlags = !this->Flags.empty()
- ? this->Flags.c_str()
+ const std::string* cmakeBuildConfiguration = !this->Configuration.empty()
+ ? &this->Configuration
+ : (cmNonempty(ctestBuildConfiguration) ? ctestBuildConfiguration
+ : &this->CTest->GetConfigType());
+
+ const std::string* cmakeBuildAdditionalFlags = !this->Flags.empty()
+ ? &this->Flags
: this->Makefile->GetDefinition("CTEST_BUILD_FLAGS");
- const char* cmakeBuildTarget = !this->Target.empty()
- ? this->Target.c_str()
+ const std::string* cmakeBuildTarget = !this->Target.empty()
+ ? &this->Target
: this->Makefile->GetDefinition("CTEST_BUILD_TARGET");
if (cmNonempty(cmakeGeneratorName)) {
if (!cmakeBuildConfiguration) {
- cmakeBuildConfiguration = "Release";
+ static const std::string sRelease = "Release";
+ cmakeBuildConfiguration = &sRelease;
}
if (this->GlobalGenerator) {
- if (this->GlobalGenerator->GetName() != cmakeGeneratorName) {
+ if (this->GlobalGenerator->GetName() != *cmakeGeneratorName) {
this->GlobalGenerator.reset();
}
}
if (!this->GlobalGenerator) {
this->GlobalGenerator =
this->Makefile->GetCMakeInstance()->CreateGlobalGenerator(
- cmakeGeneratorName);
+ *cmakeGeneratorName);
if (!this->GlobalGenerator) {
std::string e = cmStrCat("could not create generator named \"",
- cmakeGeneratorName, '"');
+ *cmakeGeneratorName, '"');
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e);
cmSystemTools::SetFatalErrorOccured();
return nullptr;
}
}
- if (strlen(cmakeBuildConfiguration) == 0) {
- const char* config = nullptr;
+ if (cmakeBuildConfiguration->empty()) {
+ const std::string* config = nullptr;
#ifdef CMAKE_INTDIR
- config = CMAKE_INTDIR;
+ static const std::string sIntDir = CMAKE_INTDIR;
+ config = &sIntDir;
#endif
if (!config) {
- config = "Debug";
+ static const std::string sDebug = "Debug";
+ config = &sDebug;
}
cmakeBuildConfiguration = config;
}
@@ -102,8 +104,8 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
std::string buildCommand =
this->GlobalGenerator->GenerateCMakeBuildCommand(
- cmakeBuildTarget ? cmakeBuildTarget : "", cmakeBuildConfiguration,
- cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "",
+ cmakeBuildTarget ? *cmakeBuildTarget : "", *cmakeBuildConfiguration,
+ cmakeBuildAdditionalFlags ? *cmakeBuildAdditionalFlags : "",
this->Makefile->IgnoreErrorsCMP0061());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" << buildCommand << "\n",
@@ -123,13 +125,14 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
}
}
- if (cmProp useLaunchers = this->Makefile->GetDef("CTEST_USE_LAUNCHERS")) {
+ if (cmProp useLaunchers =
+ this->Makefile->GetDefinition("CTEST_USE_LAUNCHERS")) {
this->CTest->SetCTestConfiguration("UseLaunchers", *useLaunchers,
this->Quiet);
}
if (cmProp labelsForSubprojects =
- this->Makefile->GetDef("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
*labelsForSubprojects, this->Quiet);
}
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 35c2b11..9997548 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -19,6 +19,7 @@
#include "cmGeneratedFileStream.h"
#include "cmMakefile.h"
#include "cmProcessOutput.h"
+#include "cmProperty.h"
#include "cmStringAlgorithms.h"
#include "cmStringReplaceHelper.h"
#include "cmSystemTools.h"
@@ -248,13 +249,14 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile* mf)
}
// Record the user-specified custom warning rules.
- if (const char* customWarningMatchers =
+ if (cmProp customWarningMatchers =
mf->GetDefinition("CTEST_CUSTOM_WARNING_MATCH")) {
- cmExpandList(customWarningMatchers, this->ReallyCustomWarningMatches);
+ cmExpandList(*customWarningMatchers, this->ReallyCustomWarningMatches);
}
- if (const char* customWarningExceptions =
+ if (cmProp customWarningExceptions =
mf->GetDefinition("CTEST_CUSTOM_WARNING_EXCEPTION")) {
- cmExpandList(customWarningExceptions, this->ReallyCustomWarningExceptions);
+ cmExpandList(*customWarningExceptions,
+ this->ReallyCustomWarningExceptions);
}
}
diff --git a/Source/CTest/cmCTestConfigureCommand.cxx b/Source/CTest/cmCTestConfigureCommand.cxx
index ac57130..db9923e 100644
--- a/Source/CTest/cmCTestConfigureCommand.cxx
+++ b/Source/CTest/cmCTestConfigureCommand.cxx
@@ -40,13 +40,13 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
cmProp ctestConfigureCommand =
- this->Makefile->GetDef("CTEST_CONFIGURE_COMMAND");
+ this->Makefile->GetDefinition("CTEST_CONFIGURE_COMMAND");
if (cmNonempty(ctestConfigureCommand)) {
this->CTest->SetCTestConfiguration("ConfigureCommand",
*ctestConfigureCommand, this->Quiet);
} else {
- const char* cmakeGeneratorName =
+ cmProp cmakeGeneratorName =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR");
if (cmNonempty(cmakeGeneratorName)) {
const std::string& source_dir =
@@ -71,7 +71,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
bool cmakeBuildTypeInOptions = false;
auto gg = this->Makefile->GetCMakeInstance()->CreateGlobalGenerator(
- cmakeGeneratorName);
+ *cmakeGeneratorName);
if (gg) {
multiConfig = gg->IsMultiConfig();
gg.reset();
@@ -103,22 +103,22 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
cmakeConfigureCommand += " \"-G";
- cmakeConfigureCommand += cmakeGeneratorName;
+ cmakeConfigureCommand += *cmakeGeneratorName;
cmakeConfigureCommand += "\"";
- const char* cmakeGeneratorPlatform =
+ cmProp cmakeGeneratorPlatform =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_PLATFORM");
if (cmNonempty(cmakeGeneratorPlatform)) {
cmakeConfigureCommand += " \"-A";
- cmakeConfigureCommand += cmakeGeneratorPlatform;
+ cmakeConfigureCommand += *cmakeGeneratorPlatform;
cmakeConfigureCommand += "\"";
}
- const char* cmakeGeneratorToolset =
+ cmProp cmakeGeneratorToolset =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR_TOOLSET");
if (cmNonempty(cmakeGeneratorToolset)) {
cmakeConfigureCommand += " \"-T";
- cmakeConfigureCommand += cmakeGeneratorToolset;
+ cmakeConfigureCommand += *cmakeGeneratorToolset;
cmakeConfigureCommand += "\"";
}
@@ -138,7 +138,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
}
if (cmProp labelsForSubprojects =
- this->Makefile->GetDef("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
*labelsForSubprojects, this->Quiet);
}
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 03b7173..731932e 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -126,7 +126,8 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
// CTEST_CONFIGURATION_TYPE script variable if it is defined.
// The current script value trumps the -C argument on the command
// line.
- cmProp ctestConfigType = this->Makefile->GetDef("CTEST_CONFIGURATION_TYPE");
+ cmProp ctestConfigType =
+ this->Makefile->GetDefinition("CTEST_CONFIGURATION_TYPE");
if (ctestConfigType) {
this->CTest->SetConfigType(*ctestConfigType);
}
@@ -160,7 +161,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
this->Quiet);
}
- if (cmProp changeId = this->Makefile->GetDef("CTEST_CHANGE_ID")) {
+ if (cmProp changeId = this->Makefile->GetDefinition("CTEST_CHANGE_ID")) {
this->CTest->SetCTestConfiguration("ChangeId", *changeId, this->Quiet);
}
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 4fa4dc0..4808c36 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -35,6 +35,7 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
@@ -372,8 +373,8 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
int cmCTestScriptHandler::ExtractVariables()
{
// Temporary variables
- const char* minInterval;
- const char* contDuration;
+ cmProp minInterval;
+ cmProp contDuration;
this->SourceDir =
this->Makefile->GetSafeDefinition("CTEST_SOURCE_DIRECTORY");
@@ -412,7 +413,7 @@ int cmCTestScriptHandler::ExtractVariables()
int i;
for (i = 1; i < 10; ++i) {
sprintf(updateVar, "CTEST_EXTRA_UPDATES_%i", i);
- const char* updateVal = this->Makefile->GetDefinition(updateVar);
+ cmProp updateVal = this->Makefile->GetDefinition(updateVar);
if (updateVal) {
if (this->UpdateCmd.empty()) {
cmSystemTools::Error(
@@ -420,7 +421,7 @@ int cmCTestScriptHandler::ExtractVariables()
" specified without specifying CTEST_CVS_COMMAND.");
return 12;
}
- this->ExtraUpdates.emplace_back(updateVal);
+ this->ExtraUpdates.emplace_back(*updateVal);
}
}
@@ -455,10 +456,10 @@ int cmCTestScriptHandler::ExtractVariables()
// the script may override the minimum continuous interval
if (minInterval) {
- this->MinimumInterval = 60 * atof(minInterval);
+ this->MinimumInterval = 60 * atof(minInterval->c_str());
}
if (contDuration) {
- this->ContinuousDuration = 60.0 * atof(contDuration);
+ this->ContinuousDuration = 60.0 * atof(contDuration->c_str());
}
this->UpdateElapsedTime();
@@ -932,13 +933,13 @@ cmDuration cmCTestScriptHandler::GetRemainingTimeAllowed()
return cmCTest::MaxDuration();
}
- const char* timelimitS = this->Makefile->GetDefinition("CTEST_TIME_LIMIT");
+ cmProp timelimitS = this->Makefile->GetDefinition("CTEST_TIME_LIMIT");
if (!timelimitS) {
return cmCTest::MaxDuration();
}
- auto timelimit = cmDuration(atof(timelimitS));
+ auto timelimit = cmDuration(atof(timelimitS->c_str()));
auto duration = std::chrono::duration_cast<cmDuration>(
std::chrono::steady_clock::now() - this->ScriptStartTime);
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index 6398d66..53e1b2f 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -9,6 +9,7 @@
#include "cmCTestVC.h"
#include "cmGeneratedFileStream.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmSystemTools.h"
class cmExecutionStatus;
@@ -29,8 +30,8 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
size_t cnt = 0;
const char* smodel = nullptr;
- const char* src_dir = nullptr;
- const char* bld_dir = nullptr;
+ const std::string* src_dir = nullptr;
+ const std::string* bld_dir = nullptr;
while (cnt < args.size()) {
if (args[cnt] == "GROUP" || args[cnt] == "TRACK") {
@@ -54,10 +55,10 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
smodel = args[cnt].c_str();
cnt++;
} else if (!src_dir) {
- src_dir = args[cnt].c_str();
+ src_dir = &args[cnt];
cnt++;
} else if (!bld_dir) {
- bld_dir = args[cnt].c_str();
+ bld_dir = &args[cnt];
cnt++;
} else {
this->SetError("Too many arguments");
@@ -87,13 +88,13 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
return false;
}
- cmSystemTools::AddKeepPath(src_dir);
- cmSystemTools::AddKeepPath(bld_dir);
+ cmSystemTools::AddKeepPath(*src_dir);
+ cmSystemTools::AddKeepPath(*bld_dir);
this->CTest->EmptyCTestConfiguration();
- std::string sourceDir = cmSystemTools::CollapseFullPath(src_dir);
- std::string binaryDir = cmSystemTools::CollapseFullPath(bld_dir);
+ std::string sourceDir = cmSystemTools::CollapseFullPath(*src_dir);
+ std::string binaryDir = cmSystemTools::CollapseFullPath(*bld_dir);
this->CTest->SetCTestConfiguration("SourceDirectory", sourceDir,
this->Quiet);
this->CTest->SetCTestConfiguration("BuildDirectory", binaryDir, this->Quiet);
@@ -102,16 +103,16 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
"Run dashboard with model "
<< smodel << std::endl
- << " Source directory: " << src_dir << std::endl
- << " Build directory: " << bld_dir << std::endl,
+ << " Source directory: " << *src_dir << std::endl
+ << " Build directory: " << *bld_dir << std::endl,
this->Quiet);
} else {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
"Run dashboard with "
"to-be-determined model"
<< std::endl
- << " Source directory: " << src_dir << std::endl
- << " Build directory: " << bld_dir << std::endl,
+ << " Source directory: " << *src_dir << std::endl
+ << " Build directory: " << *bld_dir << std::endl,
this->Quiet);
}
const char* group = this->CTest->GetSpecificGroup();
@@ -161,7 +162,7 @@ bool cmCTestStartCommand::InitialCheckout(std::ostream& ofs,
std::string const& sourceDir)
{
// Use the user-provided command to create the source tree.
- const char* initialCheckoutCommand =
+ cmProp initialCheckoutCommand =
this->Makefile->GetDefinition("CTEST_CHECKOUT_COMMAND");
if (!initialCheckoutCommand) {
initialCheckoutCommand =
@@ -171,7 +172,7 @@ bool cmCTestStartCommand::InitialCheckout(std::ostream& ofs,
// Use a generic VC object to run and log the command.
cmCTestVC vc(this->CTest, ofs);
vc.SetSourceDirectory(sourceDir);
- if (!vc.InitialCheckout(initialCheckoutCommand)) {
+ if (!vc.InitialCheckout(*initialCheckoutCommand)) {
return false;
}
}
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 026e98f..bdba0e5 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -16,6 +16,7 @@
#include "cmCommand.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
+#include "cmProperty.h"
#include "cmRange.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -37,7 +38,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
{
const std::string* submitURL = !this->SubmitURL.empty()
? &this->SubmitURL
- : this->Makefile->GetDef("CTEST_SUBMIT_URL");
+ : this->Makefile->GetDefinition("CTEST_SUBMIT_URL");
if (submitURL) {
this->CTest->SetCTestConfiguration("SubmitURL", *submitURL, this->Quiet);
@@ -58,17 +59,17 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "CurlOptions", "CTEST_CURL_OPTIONS", this->Quiet);
- const char* notesFilesVariable =
+ cmProp notesFilesVariable =
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
if (notesFilesVariable) {
- std::vector<std::string> notesFiles = cmExpandedList(notesFilesVariable);
+ std::vector<std::string> notesFiles = cmExpandedList(*notesFilesVariable);
this->CTest->GenerateNotesFile(notesFiles);
}
- const char* extraFilesVariable =
+ cmProp extraFilesVariable =
this->Makefile->GetDefinition("CTEST_EXTRA_SUBMIT_FILES");
if (extraFilesVariable) {
- std::vector<std::string> extraFiles = cmExpandedList(extraFilesVariable);
+ std::vector<std::string> extraFiles = cmExpandedList(*extraFilesVariable);
if (!this->CTest->SubmitExtraFiles(extraFiles)) {
this->SetError("problem submitting extra files.");
return nullptr;
diff --git a/Source/CTest/cmCTestTestCommand.cxx b/Source/CTest/cmCTestTestCommand.cxx
index cbc3c0c..4403733 100644
--- a/Source/CTest/cmCTestTestCommand.cxx
+++ b/Source/CTest/cmCTestTestCommand.cxx
@@ -40,12 +40,11 @@ void cmCTestTestCommand::BindArguments()
cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
{
- const char* ctestTimeout =
- this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
+ cmProp ctestTimeout = this->Makefile->GetDefinition("CTEST_TEST_TIMEOUT");
cmDuration timeout;
if (ctestTimeout) {
- timeout = cmDuration(atof(ctestTimeout));
+ timeout = cmDuration(atof(ctestTimeout->c_str()));
} else {
timeout = this->CTest->GetTimeOut();
if (timeout <= cmDuration::zero()) {
@@ -55,10 +54,10 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
}
this->CTest->SetTimeOut(timeout);
- const char* resourceSpecFile =
+ cmProp resourceSpecFile =
this->Makefile->GetDefinition("CTEST_RESOURCE_SPEC_FILE");
if (this->ResourceSpecFile.empty() && resourceSpecFile) {
- this->ResourceSpecFile = resourceSpecFile;
+ this->ResourceSpecFile = *resourceSpecFile;
}
cmCTestGenericHandler* handler = this->InitializeActualHandler();
@@ -115,7 +114,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
// or CTEST_TEST_LOAD script variable, or ctest --test-load
// command line argument... in that order.
unsigned long testLoad;
- const char* ctestTestLoad = this->Makefile->GetDefinition("CTEST_TEST_LOAD");
+ cmProp ctestTestLoad = this->Makefile->GetDefinition("CTEST_TEST_LOAD");
if (!this->TestLoad.empty()) {
if (!cmStrToULong(this->TestLoad, &testLoad)) {
testLoad = 0;
@@ -124,10 +123,10 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
<< std::endl);
}
} else if (cmNonempty(ctestTestLoad)) {
- if (!cmStrToULong(ctestTestLoad, &testLoad)) {
+ if (!cmStrToULong(*ctestTestLoad, &testLoad)) {
testLoad = 0;
cmCTestLog(this->CTest, WARNING,
- "Invalid value for 'CTEST_TEST_LOAD' : " << ctestTestLoad
+ "Invalid value for 'CTEST_TEST_LOAD' : " << *ctestTestLoad
<< std::endl);
}
} else {
@@ -136,7 +135,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
handler->SetTestLoad(testLoad);
if (cmProp labelsForSubprojects =
- this->Makefile->GetDef("CTEST_LABELS_FOR_SUBPROJECTS")) {
+ this->Makefile->GetDefinition("CTEST_LABELS_FOR_SUBPROJECTS")) {
this->CTest->SetCTestConfiguration("LabelsForSubprojects",
*labelsForSubprojects, this->Quiet);
}
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index abd1207..4d1a589 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -37,6 +37,7 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStringAlgorithms.h"
@@ -1764,9 +1765,9 @@ bool cmCTestTestHandler::GetListOfTests()
// SEND_ERROR or FATAL_ERROR in CTestTestfile or TEST_INCLUDE_FILES
return false;
}
- const char* specFile = mf.GetDefinition("CTEST_RESOURCE_SPEC_FILE");
+ cmProp specFile = mf.GetDefinition("CTEST_RESOURCE_SPEC_FILE");
if (this->ResourceSpecFile.empty() && specFile) {
- this->ResourceSpecFile = specFile;
+ this->ResourceSpecFile = *specFile;
}
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Done constructing a list of tests" << std::endl,
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 95cae13..6fef90a 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -5,6 +5,7 @@
#include "cmCTest.h"
#include "cmCTestUpdateHandler.h"
#include "cmMakefile.h"
+#include "cmProperty.h"
#include "cmSystemTools.h"
cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
@@ -17,7 +18,7 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->SetCTestConfiguration(
"SourceDirectory",
cmSystemTools::CollapseFullPath(
- this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY")),
+ cmToCStrSafe(this->Makefile->GetDefinition("CTEST_SOURCE_DIRECTORY"))),
this->Quiet);
}
std::string source_dir =