Hi,

The progress ticks and information about the length of the output are
useful when the actual output is not visible.

When the output is printed, the progress ticks

* add no useful information
* do not look pretty
* make the output hard to parse for tools.

The attached patch hides the progress ticks when the output is shown (-VV).

Cheers, Daniel
From 31290dd36fff5fd88a66069d962a9e3c80746525 Mon Sep 17 00:00:00 2001
From: Daniel Pfeifer <dan...@pfeifer-mail.de>
Date: Fri, 3 Jul 2015 22:52:23 +0200
Subject: [PATCH] CTest: hide progress ticks in verbose output

---
 Source/CTest/cmCTestBuildHandler.cxx | 10 +++++-----
 Source/cmCTest.cxx                   | 14 ++++++++++----
 Source/cmCTest.h                     |  1 +
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index e141b60..6dbb245 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -920,7 +920,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
 
   char* data;
   int length;
-  cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+  cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT,
     "   Each symbol represents " << tick_len << " bytes of output."
     << std::endl
     << (this->UseCTestLaunch? "" :
@@ -968,7 +968,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
   this->ProcessBuffer(0, 0, tick, tick_len, ofs, &this->BuildProcessingQueue);
   this->ProcessBuffer(0, 0, tick, tick_len, ofs,
     &this->BuildProcessingErrorQueue);
-  cmCTestOptionalLog(this->CTest, OUTPUT, " Size of output: "
+  cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, " Size of output: "
     << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl,
     this->Quiet);
 
@@ -1175,12 +1175,12 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
   while ( this->BuildOutputLogSize > (tick * tick_len) )
     {
     tick ++;
-    cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, this->LastTickChar,
-      this->Quiet);
+    cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT,
+      this->LastTickChar, this->Quiet);
     tickDisplayed = true;
     if ( tick % tick_line_len == 0 && tick > 0 )
       {
-      cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "  Size: "
+      cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT, "  Size: "
         << ((this->BuildOutputLogSize + 512) / 1024) << "K" << std::endl
         << "    ", this->Quiet);
       }
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 5887ba8..5676dda 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1220,7 +1220,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
 
   char* data;
   int length;
-  cmCTestLog(this, HANDLER_OUTPUT,
+  cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
     "   Each . represents " << tick_len << " bytes of output" << std::endl
     << "    " << std::flush);
   while(cmsysProcess_WaitForData(cp, &data, &length, 0))
@@ -1236,10 +1236,10 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
     while ( output.size() > (tick * tick_len) )
       {
       tick ++;
-      cmCTestLog(this, HANDLER_OUTPUT, "." << std::flush);
+      cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, "." << std::flush);
       if ( tick % tick_line_len == 0 && tick > 0 )
         {
-        cmCTestLog(this, HANDLER_OUTPUT,
+        cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
                    "  Size: "
                    << int((double(output.size()) / 1024.0) + 1)
                    << "K" << std::endl
@@ -1252,7 +1252,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
       ofs << cmCTestLogWrite(data, length);
       }
     }
-  cmCTestLog(this, OUTPUT, " Size of output: "
+  cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, " Size of output: "
     << int(double(output.size()) / 1024.0) << "K" << std::endl);
 
   cmsysProcess_WaitForExit(cp, 0);
@@ -3101,6 +3101,7 @@ static const char* cmCTestStringLogType[] =
   "DEBUG",
   "OUTPUT",
   "HANDLER_OUTPUT",
+  "HANDLER_PROGRESS_OUTPUT",
   "HANDLER_VERBOSE_OUTPUT",
   "WARNING",
   "ERROR_MESSAGE",
@@ -3139,6 +3140,11 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
     {
     return;
     }
+  if ( logType == cmCTest::HANDLER_PROGRESS_OUTPUT &&
+      ( this->Debug || this->ExtraVerbose ) )
+    {
+    return;
+    }
   if ( this->OutputLogFile )
     {
     bool display = true;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 47245ae..73c2807 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -382,6 +382,7 @@ public:
     DEBUG = 0,
     OUTPUT,
     HANDLER_OUTPUT,
+    HANDLER_PROGRESS_OUTPUT,
     HANDLER_VERBOSE_OUTPUT,
     WARNING,
     ERROR_MESSAGE,
-- 
2.4.5

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to