diff options
author | Brad King <brad.king@kitware.com> | 2019-08-05 14:40:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-05 14:42:50 (GMT) |
commit | 2327cc0e0575175e8dec4b7a6fa6cafd5d0f7ca9 (patch) | |
tree | 0e0ac231e503b95b16112189407c160158def992 /Source/CTest | |
parent | c969d4628bff6c5b45c788d3a61fff85c36272f6 (diff) | |
parent | 41364824ad84a40c9906b7b5de492e45a74c8945 (diff) | |
download | CMake-2327cc0e0575175e8dec4b7a6fa6cafd5d0f7ca9.zip CMake-2327cc0e0575175e8dec4b7a6fa6cafd5d0f7ca9.tar.gz CMake-2327cc0e0575175e8dec4b7a6fa6cafd5d0f7ca9.tar.bz2 |
Merge topic 'control-block3'
41364824ad cmFunctionBlocker: Recycle functions
6491270e0d cmFunctionBlocker: Move check for matching args
af24e4ef6e cmFunctionBlocker: Move common logic to base
ef38ff22f7 cm*FunctionBlocker: Extract function Replay
b51fba6298 cmMakefile: Add OnExecuteCommand callback
c76500949d cm*FunctionBlocker: Move to source file
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3632
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 7a5b8d1..f8d9f1b 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -24,7 +24,6 @@ #include "cmCTestUploadCommand.h" #include "cmCommand.h" #include "cmDuration.h" -#include "cmFunctionBlocker.h" #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" @@ -49,32 +48,8 @@ # include <unistd.h> #endif -class cmExecutionStatus; -struct cmListFileFunction; - #define CTEST_INITIAL_CMAKE_OUTPUT_FILE_NAME "CTestInitialCMakeOutput.log" -// used to keep elapsed time up to date -class cmCTestScriptFunctionBlocker : public cmFunctionBlocker -{ -public: - bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf, - cmExecutionStatus& /*status*/) override; - // virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf); - // virtual void ScopeEnded(cmMakefile &mf); - - cmCTestScriptHandler* CTestScriptHandler; -}; - -// simply update the time and don't block anything -bool cmCTestScriptFunctionBlocker::IsFunctionBlocked( - const cmListFileFunction& /*lff*/, cmMakefile& /*mf*/, - cmExecutionStatus& /*status*/) -{ - this->CTestScriptHandler->UpdateElapsedTime(); - return false; -} - cmCTestScriptHandler::cmCTestScriptHandler() { this->Backup = false; @@ -373,12 +348,8 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg) this->Makefile->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); #endif - // always add a function blocker to update the elapsed time - { - auto fb = cm::make_unique<cmCTestScriptFunctionBlocker>(); - fb->CTestScriptHandler = this; - this->Makefile->AddFunctionBlocker(std::move(fb)); - } + // set a callback function to update the elapsed time + this->Makefile->OnExecuteCommand([this] { this->UpdateElapsedTime(); }); /* Execute CTestScriptMode.cmake, which loads CMakeDetermineSystem and CMakeSystemSpecificInformation, so |