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
This commit is contained in:
Brad King
2018-01-29 13:04:54 +00:00
committed by Kitware Robot
11 changed files with 50 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -107,6 +107,8 @@ public:
void CreateCMake();
cmake* GetCMake() { return this->CMake; }
void SetRunCurrentScript(bool value);
private:
// reads in a script
int ReadInScript(const std::string& total_script_arg);
@@ -137,6 +139,8 @@ private:
std::vector<std::string> ConfigurationScripts;
std::vector<bool> ScriptProcessScope;
bool ShouldRunCurrentScript;
bool Backup;
bool EmptyBinDir;
bool EmptyBinDirOnce;

View File

@@ -126,7 +126,7 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
return false;
}
this->Makefile->AddDefinition("CTEST_RUN_CURRENT_SCRIPT", "OFF");
this->CTest->SetRunCurrentScript(false);
this->CTest->SetSuppressUpdatingCTestConfiguration(true);
int model = this->CTest->GetTestModelFromString(smodel);
this->CTest->SetTestModel(model);