Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_reporter_console.h
Go to the documentation of this file.
1/*
2 * Created by Phil on 5/12/2012.
3 * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
4 *
5 * Distributed under the Boost Software License, Version 1.0. (See accompanying
6 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 */
8#ifndef TWOBLUECUBES_CATCH_REPORTER_CONSOLE_H_INCLUDED
9#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_H_INCLUDED
10
12
13#if defined(_MSC_VER)
14#pragma warning(push)
15#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
16 // Note that 4062 (not all labels are handled
17 // and default is missing) is enabled
18#endif
19
20
21namespace Catch {
22 // Fwd decls
23 struct SummaryColumn;
24 class TablePrinter;
25
26 struct ConsoleReporter : StreamingReporterBase<ConsoleReporter> {
27 std::unique_ptr<TablePrinter> m_tablePrinter;
28
30 ~ConsoleReporter() override;
31 static std::string getDescription();
32
33 void noMatchingTestCases(std::string const& spec) override;
34
35 void assertionStarting(AssertionInfo const&) override;
36
37 bool assertionEnded(AssertionStats const& _assertionStats) override;
38
39 void sectionStarting(SectionInfo const& _sectionInfo) override;
40 void sectionEnded(SectionStats const& _sectionStats) override;
41
42
43 void benchmarkStarting(BenchmarkInfo const& info) override;
44 void benchmarkEnded(BenchmarkStats const& stats) override;
45
46 void testCaseEnded(TestCaseStats const& _testCaseStats) override;
47 void testGroupEnded(TestGroupStats const& _testGroupStats) override;
48 void testRunEnded(TestRunStats const& _testRunStats) override;
49 void testRunStarting(TestRunInfo const& _testRunInfo) override;
50 private:
51
52 void lazyPrint();
53
54 void lazyPrintWithoutClosingBenchmarkTable();
55 void lazyPrintRunInfo();
56 void lazyPrintGroupInfo();
57 void printTestCaseAndSectionHeader();
58
59 void printClosedHeader(std::string const& _name);
60 void printOpenHeader(std::string const& _name);
61
62 // if string has a : in first line will set indent to follow it on
63 // subsequent lines
64 void printHeaderString(std::string const& _string, std::size_t indent = 0);
65
66
67 void printTotals(Totals const& totals);
68 void printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row);
69
70 void printTotalsDivider(Totals const& totals);
71 void printSummaryDivider();
72 void printTestFilters();
73
74 private:
75 bool m_headerPrinted = false;
76 };
77
78} // end namespace Catch
79
80#if defined(_MSC_VER)
81#pragma warning(pop)
82#endif
83
84#endif // TWOBLUECUBES_CATCH_REPORTER_CONSOLE_H_INCLUDED
ConsoleReporter(ReporterConfig const &config)
void testCaseEnded(TestCaseStats const &_testCaseStats) override
static std::string getDescription()
void sectionStarting(SectionInfo const &_sectionInfo) override
void testRunEnded(TestRunStats const &_testRunStats) override
void benchmarkStarting(BenchmarkInfo const &info) override
void noMatchingTestCases(std::string const &spec) override
std::unique_ptr< TablePrinter > m_tablePrinter
void sectionEnded(SectionStats const &_sectionStats) override
void testRunStarting(TestRunInfo const &_testRunInfo) override
bool assertionEnded(AssertionStats const &_assertionStats) override
void assertionStarting(AssertionInfo const &) override
void testGroupEnded(TestGroupStats const &_testGroupStats) override
void benchmarkEnded(BenchmarkStats const &stats) override
~ConsoleReporter() override
char * label