summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestScriptHandler.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-29 13:04:54 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-01-29 13:04:59 (GMT)
commit18153217e27d2cf560d874313557ec9fa2bcffdb (patch)
tree5ac3c0c076a3c6be4f8fcd9607106bbfccaa9b73 /Source/CTest/cmCTestScriptHandler.cxx
parenta271286f417731916cd60c546665ec030bc5b2c7 (diff)
parent13347740e2fe00ad51493c89087f1bbbc35b224c (diff)
downloadCMake-18153217e27d2cf560d874313557ec9fa2bcffdb.zip
CMake-18153217e27d2cf560d874313557ec9fa2bcffdb.tar.gz
CMake-18153217e27d2cf560d874313557ec9fa2bcffdb.tar.bz2
Merge topic 'ctest_start_function_scope'
13347740 Help: add release notes, documentation for CTEST_RUN_CURRENT_SCRIPT behavior 74092d92 cmCTestScriptHandler: Add new field ShouldRunCurrentScript Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1703
Diffstat (limited to 'Source/CTest/cmCTestScriptHandler.cxx')
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 78ab5ff..759b695 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -346,6 +346,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
this->Makefile->AddDefinition("CMAKE_EXECUTABLE_NAME",
cmSystemTools::GetCMakeCommand().c_str());
this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", true);
+ this->SetRunCurrentScript(true);
this->UpdateElapsedTime();
// add the script arg if defined
@@ -527,7 +528,8 @@ int cmCTestScriptHandler::RunConfigurationScript(
}
// only run the curent script if we should
- if (this->Makefile && this->Makefile->IsOn("CTEST_RUN_CURRENT_SCRIPT")) {
+ if (this->Makefile && this->Makefile->IsOn("CTEST_RUN_CURRENT_SCRIPT") &&
+ this->ShouldRunCurrentScript) {
return this->RunCurrentScript();
}
return result;
@@ -538,7 +540,7 @@ int cmCTestScriptHandler::RunCurrentScript()
int result;
// do not run twice
- this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", false);
+ this->SetRunCurrentScript(false);
// no popup widows
cmSystemTools::SetRunCommandHideConsole(true);
@@ -980,3 +982,8 @@ cmDuration cmCTestScriptHandler::GetRemainingTimeAllowed()
std::chrono::steady_clock::now() - this->ScriptStartTime);
return (timelimit - duration);
}
+
+void cmCTestScriptHandler::SetRunCurrentScript(bool value)
+{
+ this->ShouldRunCurrentScript = value;
+}