diff options
| author | Phil Nash | 2017-08-09 23:27:29 +0100 |
|---|---|---|
| committer | Phil Nash | 2017-08-11 22:24:52 +0100 |
| commit | 1aab791d67a8a4072156db22d80c1a863dcdb593 (patch) | |
| tree | 5e206ad3f417fcbd89a23f3a3620cee43e2f89bf /include | |
| parent | eed4ae86ad38b2d04670e44a941bd96129906f4c (diff) | |
| download | catch3-1aab791d67a8a4072156db22d80c1a863dcdb593.tar.gz | |
reformatted benchmark output a bit
Diffstat (limited to 'include')
| -rw-r--r-- | include/reporters/catch_reporter_bases.hpp | 10 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_console.cpp | 10 |
2 files changed, 4 insertions, 16 deletions
diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp index 2f9a8013..cfba9415 100644 --- a/include/reporters/catch_reporter_bases.hpp +++ b/include/reporters/catch_reporter_bases.hpp @@ -259,16 +259,6 @@ namespace Catch { } return line; } - inline char const* getBoxCharsAcross() { - static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0}; - if( !*line ) { - std::memset( line, '-', CATCH_CONFIG_CONSOLE_WIDTH-1 ); - line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0; - line[0] = '+'; - line[CATCH_CONFIG_CONSOLE_WIDTH-2] = '+'; - } - return line; - } struct TestEventListenerBase : StreamingReporterBase<TestEventListenerBase> { diff --git a/include/reporters/catch_reporter_console.cpp b/include/reporters/catch_reporter_console.cpp index 33259041..ca102df6 100644 --- a/include/reporters/catch_reporter_console.cpp +++ b/include/reporters/catch_reporter_console.cpp @@ -65,6 +65,7 @@ namespace { for( auto const& info : m_columnInfos ) *this << info.name << ColumnBreak(); *this << RowBreak(); + m_os << Catch::getLineOfChars<'-'>() << "\n"; } } void close() { @@ -91,8 +92,6 @@ namespace { tp.m_currentColumn = -1; tp.m_os << "\n"; } - if( tp.m_currentColumn == -1 ) - tp.m_os << "|"; tp.m_currentColumn++; auto colInfo = tp.m_columnInfos[tp.m_currentColumn]; @@ -100,9 +99,9 @@ namespace { ? std::string( colInfo.width-(strSize+2), ' ' ) : std::string(); if( colInfo.justification == ColumnInfo::Left ) - tp.m_os << " " << colStr << padding << " |"; + tp.m_os << colStr << padding << " "; else - tp.m_os << " " << padding << colStr << " |"; + tp.m_os << padding << colStr << " "; return tp; } @@ -111,7 +110,6 @@ namespace { tp.m_os << "\n"; tp.m_currentColumn = -1; } - tp.m_os << Catch::getBoxCharsAcross() << "\n"; return tp; } }; @@ -199,7 +197,7 @@ namespace Catch { : StreamingReporterBase( config ), m_tablePrinter( config.stream(), { - { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH-42, ColumnInfo::Left }, + { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH-32, ColumnInfo::Left }, { "iters", 8, ColumnInfo::Right }, { "elapsed ns", 14, ColumnInfo::Right }, { "average", 14, ColumnInfo::Right } |