diff options
author | Brad King <brad.king@kitware.com> | 2018-01-29 13:04:54 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-01-29 13:04:59 (GMT) |
commit | 18153217e27d2cf560d874313557ec9fa2bcffdb (patch) | |
tree | 5ac3c0c076a3c6be4f8fcd9607106bbfccaa9b73 /Source | |
parent | a271286f417731916cd60c546665ec030bc5b2c7 (diff) | |
parent | 13347740e2fe00ad51493c89087f1bbbc35b224c (diff) | |
download | CMake-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')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 11 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.h | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestStartCommand.cxx | 2 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 8 | ||||
-rw-r--r-- | Source/cmCTest.h | 2 |
5 files changed, 24 insertions, 3 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; +} diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h index ea5d5af..cf0762e 100644 --- a/Source/CTest/cmCTestScriptHandler.h +++ b/Source/CTest/cmCTestScriptHandler.h @@ -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; diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx index 4f0d87b..38ee623 100644 --- a/Source/CTest/cmCTestStartCommand.cxx +++ b/Source/CTest/cmCTestStartCommand.cxx @@ -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); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 9e76480..6f90e70 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2797,6 +2797,14 @@ cmDuration cmCTest::MaxDuration() return cmDuration(1.0e7); } +void cmCTest::SetRunCurrentScript(bool value) +{ + cmCTestScriptHandler* ch = + static_cast<cmCTestScriptHandler*>(this->GetHandler("script")); + + ch->SetRunCurrentScript(value); +} + void cmCTest::OutputTestErrors(std::vector<char> const& process_output) { std::string test_outputs("\n*** Test Failed:\n"); diff --git a/Source/cmCTest.h b/Source/cmCTest.h index a4d9a86..673a40e 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -458,6 +458,8 @@ public: void GenerateSubprojectsOutput(cmXMLWriter& xml); std::vector<std::string> GetLabelsForSubprojects(); + void SetRunCurrentScript(bool value); + private: int RepeatTests; bool RepeatUntilFail; |