From f33d875a844114945f3e698266639a63401f6ac1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Jul 2014 10:23:23 -0400 Subject: [PATCH] CTest: Implement message(STATUS) output for 'ctest -S' scripts Send status messages to the CTest HANDLER_OUTPUT log since they are part of the script handler output. This also ensures they appear inline with other test command handler output. --- Source/CTest/cmCTestScriptHandler.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 567acfc95..f050148d1 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -317,6 +317,15 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg) return retVal; } +static void ctestScriptProgressCallback(const char *m, float, void* cd) +{ + cmCTest* ctest = static_cast(cd); + if(m && *m) + { + cmCTestLog(ctest, HANDLER_OUTPUT, "-- " << m << std::endl); + } +} + void cmCTestScriptHandler::CreateCMake() { // create a cmake instance to read the configuration script @@ -334,6 +343,8 @@ void cmCTestScriptHandler::CreateCMake() this->LocalGenerator = this->GlobalGenerator->CreateLocalGenerator(); this->Makefile = this->LocalGenerator->GetMakefile(); + this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); + // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR. // Also, some commands need Makefile->GetCurrentDirectory(). std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();