Merge topic 'ctest-progress-ticks'

140b1864 CTest: hide progress ticks in verbose output
This commit is contained in:
Brad King 2015-07-07 09:53:44 -04:00 committed by CMake Topic Stage
commit 18fdf13192
3 changed files with 16 additions and 9 deletions

View File

@ -920,7 +920,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
char* data; char* data;
int length; int length;
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT,
" Each symbol represents " << tick_len << " bytes of output." " Each symbol represents " << tick_len << " bytes of output."
<< std::endl << std::endl
<< (this->UseCTestLaunch? "" : << (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->BuildProcessingQueue);
this->ProcessBuffer(0, 0, tick, tick_len, ofs, this->ProcessBuffer(0, 0, tick, tick_len, ofs,
&this->BuildProcessingErrorQueue); &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->BuildOutputLogSize + 512) / 1024) << "K" << std::endl,
this->Quiet); this->Quiet);
@ -1175,12 +1175,12 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
while ( this->BuildOutputLogSize > (tick * tick_len) ) while ( this->BuildOutputLogSize > (tick * tick_len) )
{ {
tick ++; tick ++;
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, this->LastTickChar, cmCTestOptionalLog(this->CTest, HANDLER_PROGRESS_OUTPUT,
this->Quiet); this->LastTickChar, this->Quiet);
tickDisplayed = true; tickDisplayed = true;
if ( tick % tick_line_len == 0 && tick > 0 ) 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->BuildOutputLogSize + 512) / 1024) << "K" << std::endl
<< " ", this->Quiet); << " ", this->Quiet);
} }

View File

@ -1220,7 +1220,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
char* data; char* data;
int length; int length;
cmCTestLog(this, HANDLER_OUTPUT, cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
" Each . represents " << tick_len << " bytes of output" << std::endl " Each . represents " << tick_len << " bytes of output" << std::endl
<< " " << std::flush); << " " << std::flush);
while(cmsysProcess_WaitForData(cp, &data, &length, 0)) 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) ) while ( output.size() > (tick * tick_len) )
{ {
tick ++; tick ++;
cmCTestLog(this, HANDLER_OUTPUT, "." << std::flush); cmCTestLog(this, HANDLER_PROGRESS_OUTPUT, "." << std::flush);
if ( tick % tick_line_len == 0 && tick > 0 ) if ( tick % tick_line_len == 0 && tick > 0 )
{ {
cmCTestLog(this, HANDLER_OUTPUT, cmCTestLog(this, HANDLER_PROGRESS_OUTPUT,
" Size: " " Size: "
<< int((double(output.size()) / 1024.0) + 1) << int((double(output.size()) / 1024.0) + 1)
<< "K" << std::endl << "K" << std::endl
@ -1252,7 +1252,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
ofs << cmCTestLogWrite(data, length); 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); << int(double(output.size()) / 1024.0) << "K" << std::endl);
cmsysProcess_WaitForExit(cp, 0); cmsysProcess_WaitForExit(cp, 0);
@ -3101,6 +3101,7 @@ static const char* cmCTestStringLogType[] =
"DEBUG", "DEBUG",
"OUTPUT", "OUTPUT",
"HANDLER_OUTPUT", "HANDLER_OUTPUT",
"HANDLER_PROGRESS_OUTPUT",
"HANDLER_VERBOSE_OUTPUT", "HANDLER_VERBOSE_OUTPUT",
"WARNING", "WARNING",
"ERROR_MESSAGE", "ERROR_MESSAGE",
@ -3139,6 +3140,11 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
{ {
return; return;
} }
if ( logType == cmCTest::HANDLER_PROGRESS_OUTPUT &&
( this->Debug || this->ExtraVerbose ) )
{
return;
}
if ( this->OutputLogFile ) if ( this->OutputLogFile )
{ {
bool display = true; bool display = true;

View File

@ -382,6 +382,7 @@ public:
DEBUG = 0, DEBUG = 0,
OUTPUT, OUTPUT,
HANDLER_OUTPUT, HANDLER_OUTPUT,
HANDLER_PROGRESS_OUTPUT,
HANDLER_VERBOSE_OUTPUT, HANDLER_VERBOSE_OUTPUT,
WARNING, WARNING,
ERROR_MESSAGE, ERROR_MESSAGE,