#include <catch_reporter_console.h>
Definition at line 26 of file catch_reporter_console.h.
◆ ConsoleReporter()
Catch::ConsoleReporter::ConsoleReporter |
( |
ReporterConfig const & | config | ) |
|
Definition at line 338 of file catch_reporter_console.cpp.
341 {
342 { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 32, ColumnInfo::Left },
343 { "iters", 8, ColumnInfo::Right },
344 { "elapsed ns", 14, ColumnInfo::Right },
345 { "average", 14, ColumnInfo::Right }
346 })) {}
std::unique_ptr< TablePrinter > m_tablePrinter
StreamingReporterBase(ReporterConfig const &_config)
◆ ~ConsoleReporter()
Catch::ConsoleReporter::~ConsoleReporter |
( |
| ) |
|
|
overridedefault |
◆ assertionEnded()
bool Catch::ConsoleReporter::assertionEnded |
( |
AssertionStats const & | _assertionStats | ) |
|
|
overridevirtual |
Implements Catch::IStreamingReporter.
Definition at line 359 of file catch_reporter_console.cpp.
359 {
360 AssertionResult const& result = _assertionStats.assertionResult;
361
362 bool includeResults =
m_config->includeSuccessfulResults() || !result.isOk();
363
364
366 return false;
367
368 lazyPrint();
369
370 ConsoleAssertionPrinter printer(
stream, _assertionStats, includeResults);
371 printer.print();
373 return true;
374}
◆ assertionStarting()
void Catch::ConsoleReporter::assertionStarting |
( |
AssertionInfo const & | | ) |
|
|
overridevirtual |
◆ benchmarkEnded()
void Catch::ConsoleReporter::benchmarkEnded |
( |
BenchmarkStats const & | stats | ) |
|
|
overridevirtual |
Reimplemented from Catch::IStreamingReporter.
Definition at line 416 of file catch_reporter_console.cpp.
416 {
417 Duration average(stats.elapsedTimeInNanoseconds / stats.iterations);
418 (*m_tablePrinter)
419 << stats.iterations << ColumnBreak()
420 << stats.elapsedTimeInNanoseconds << ColumnBreak()
421 << average << ColumnBreak();
422}
◆ benchmarkStarting()
void Catch::ConsoleReporter::benchmarkStarting |
( |
BenchmarkInfo const & | info | ) |
|
|
overridevirtual |
Reimplemented from Catch::IStreamingReporter.
Definition at line 401 of file catch_reporter_console.cpp.
401 {
402 lazyPrintWithoutClosingBenchmarkTable();
403
404 auto nameCol = Column( info.name ).width(
static_cast<std::size_t
>(
m_tablePrinter->columnInfos()[0].width - 2 ) );
405
406 bool firstLine = true;
407 for (auto line : nameCol) {
408 if (!firstLine)
409 (*m_tablePrinter) << ColumnBreak() << ColumnBreak() << ColumnBreak();
410 else
411 firstLine = false;
412
413 (*m_tablePrinter) << line << ColumnBreak();
414 }
415}
◆ getDescription()
std::string Catch::ConsoleReporter::getDescription |
( |
| ) |
|
|
static |
◆ noMatchingTestCases()
void Catch::ConsoleReporter::noMatchingTestCases |
( |
std::string const & | spec | ) |
|
|
overridevirtual |
◆ sectionEnded()
void Catch::ConsoleReporter::sectionEnded |
( |
SectionStats const & | _sectionStats | ) |
|
|
overridevirtual |
Implements Catch::IStreamingReporter.
Definition at line 380 of file catch_reporter_console.cpp.
380 {
382 if (_sectionStats.missingAssertions) {
383 lazyPrint();
386 stream <<
"\nNo assertions in section";
387 else
388 stream <<
"\nNo assertions in test case";
389 stream <<
" '" << _sectionStats.sectionInfo.name <<
"'\n" << std::endl;
390 }
393 }
394 if (m_headerPrinted) {
395 m_headerPrinted = false;
396 }
398}
std::string getFormattedDuration(double duration)
std::vector< SectionInfo > m_sectionStack
void sectionEnded(SectionStats const &) override
◆ sectionStarting()
void Catch::ConsoleReporter::sectionStarting |
( |
SectionInfo const & | _sectionInfo | ) |
|
|
overridevirtual |
◆ testCaseEnded()
void Catch::ConsoleReporter::testCaseEnded |
( |
TestCaseStats const & | _testCaseStats | ) |
|
|
overridevirtual |
◆ testGroupEnded()
void Catch::ConsoleReporter::testGroupEnded |
( |
TestGroupStats const & | _testGroupStats | ) |
|
|
overridevirtual |
Implements Catch::IStreamingReporter.
Definition at line 429 of file catch_reporter_console.cpp.
429 {
431 printSummaryDivider();
432 stream <<
"Summary for group '" << _testGroupStats.groupInfo.name <<
"':\n";
433 printTotals(_testGroupStats.totals);
434 stream <<
'\n' << std::endl;
435 }
437}
LazyStat< GroupInfo > currentGroupInfo
void testGroupEnded(TestGroupStats const &) override
◆ testRunEnded()
void Catch::ConsoleReporter::testRunEnded |
( |
TestRunStats const & | _testRunStats | ) |
|
|
overridevirtual |
◆ testRunStarting()
void Catch::ConsoleReporter::testRunStarting |
( |
TestRunInfo const & | _testRunInfo | ) |
|
|
overridevirtual |
◆ m_tablePrinter
std::unique_ptr<TablePrinter> Catch::ConsoleReporter::m_tablePrinter |
The documentation for this struct was generated from the following files: