Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::ListeningReporter Class Reference

#include <catch_reporter_listening.h>

Inheritance diagram for Catch::ListeningReporter:
Collaboration diagram for Catch::ListeningReporter:

Public Member Functions

 ListeningReporter ()
 
void addListener (IStreamingReporterPtr &&listener)
 
void addReporter (IStreamingReporterPtr &&reporter)
 
ReporterPreferences getPreferences () const override
 
void noMatchingTestCases (std::string const &spec) override
 
void benchmarkStarting (BenchmarkInfo const &benchmarkInfo) override
 
void benchmarkEnded (BenchmarkStats const &benchmarkStats) override
 
void testRunStarting (TestRunInfo const &testRunInfo) override
 
void testGroupStarting (GroupInfo const &groupInfo) override
 
void testCaseStarting (TestCaseInfo const &testInfo) override
 
void sectionStarting (SectionInfo const &sectionInfo) override
 
void assertionStarting (AssertionInfo const &assertionInfo) override
 
bool assertionEnded (AssertionStats const &assertionStats) override
 
void sectionEnded (SectionStats const &sectionStats) override
 
void testCaseEnded (TestCaseStats const &testCaseStats) override
 
void testGroupEnded (TestGroupStats const &testGroupStats) override
 
void testRunEnded (TestRunStats const &testRunStats) override
 
void skipTest (TestCaseInfo const &testInfo) override
 
bool isMulti () const override
 
- Public Member Functions inherited from Catch::IStreamingReporter
virtual ~IStreamingReporter ()=default
 
virtual void fatalErrorEncountered (StringRef name)
 

Static Public Member Functions

static std::set< VerbositygetSupportedVerbosities ()
 

Detailed Description

Definition at line 14 of file catch_reporter_listening.h.

Constructor & Destructor Documentation

◆ ListeningReporter()

Catch::ListeningReporter::ListeningReporter ( )

Definition at line 14 of file catch_reporter_listening.cpp.

14 {
15 // We will assume that listeners will always want all assertions
16 m_preferences.shouldReportAllAssertions = true;
17 }

Member Function Documentation

◆ addListener()

void Catch::ListeningReporter::addListener ( IStreamingReporterPtr && listener)

Definition at line 19 of file catch_reporter_listening.cpp.

19 {
20 m_listeners.push_back( std::move( listener ) );
21 }

◆ addReporter()

void Catch::ListeningReporter::addReporter ( IStreamingReporterPtr && reporter)

Definition at line 23 of file catch_reporter_listening.cpp.

23 {
24 assert(!m_reporter && "Listening reporter can wrap only 1 real reporter");
25 m_reporter = std::move( reporter );
26 m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut;
27 }

◆ assertionEnded()

bool Catch::ListeningReporter::assertionEnded ( AssertionStats const & assertionStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 95 of file catch_reporter_listening.cpp.

95 {
96 for( auto const& listener : m_listeners ) {
97 static_cast<void>( listener->assertionEnded( assertionStats ) );
98 }
99 return m_reporter->assertionEnded( assertionStats );
100 }

◆ assertionStarting()

void Catch::ListeningReporter::assertionStarting ( AssertionInfo const & assertionInfo)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 87 of file catch_reporter_listening.cpp.

87 {
88 for ( auto const& listener : m_listeners ) {
89 listener->assertionStarting( assertionInfo );
90 }
91 m_reporter->assertionStarting( assertionInfo );
92 }

◆ benchmarkEnded()

void Catch::ListeningReporter::benchmarkEnded ( BenchmarkStats const & benchmarkStats)
overridevirtual

Reimplemented from Catch::IStreamingReporter.

Definition at line 51 of file catch_reporter_listening.cpp.

51 {
52 for ( auto const& listener : m_listeners ) {
53 listener->benchmarkEnded( benchmarkStats );
54 }
55 m_reporter->benchmarkEnded( benchmarkStats );
56 }

◆ benchmarkStarting()

void Catch::ListeningReporter::benchmarkStarting ( BenchmarkInfo const & benchmarkInfo)
overridevirtual

Reimplemented from Catch::IStreamingReporter.

Definition at line 45 of file catch_reporter_listening.cpp.

45 {
46 for ( auto const& listener : m_listeners ) {
47 listener->benchmarkStarting( benchmarkInfo );
48 }
49 m_reporter->benchmarkStarting( benchmarkInfo );
50 }

◆ getPreferences()

ReporterPreferences Catch::ListeningReporter::getPreferences ( ) const
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 29 of file catch_reporter_listening.cpp.

29 {
30 return m_preferences;
31 }

◆ getSupportedVerbosities()

std::set< Verbosity > Catch::ListeningReporter::getSupportedVerbosities ( )
static

Definition at line 33 of file catch_reporter_listening.cpp.

33 {
34 return std::set<Verbosity>{ };
35 }

◆ isMulti()

bool Catch::ListeningReporter::isMulti ( ) const
overridevirtual

Reimplemented from Catch::IStreamingReporter.

Definition at line 138 of file catch_reporter_listening.cpp.

138 {
139 return true;
140 }

◆ noMatchingTestCases()

void Catch::ListeningReporter::noMatchingTestCases ( std::string const & spec)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 38 of file catch_reporter_listening.cpp.

38 {
39 for ( auto const& listener : m_listeners ) {
40 listener->noMatchingTestCases( spec );
41 }
42 m_reporter->noMatchingTestCases( spec );
43 }

◆ sectionEnded()

void Catch::ListeningReporter::sectionEnded ( SectionStats const & sectionStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 102 of file catch_reporter_listening.cpp.

102 {
103 for ( auto const& listener : m_listeners ) {
104 listener->sectionEnded( sectionStats );
105 }
106 m_reporter->sectionEnded( sectionStats );
107 }

◆ sectionStarting()

void Catch::ListeningReporter::sectionStarting ( SectionInfo const & sectionInfo)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 80 of file catch_reporter_listening.cpp.

80 {
81 for ( auto const& listener : m_listeners ) {
82 listener->sectionStarting( sectionInfo );
83 }
84 m_reporter->sectionStarting( sectionInfo );
85 }

◆ skipTest()

void Catch::ListeningReporter::skipTest ( TestCaseInfo const & testInfo)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 131 of file catch_reporter_listening.cpp.

131 {
132 for ( auto const& listener : m_listeners ) {
133 listener->skipTest( testInfo );
134 }
135 m_reporter->skipTest( testInfo );
136 }

◆ testCaseEnded()

void Catch::ListeningReporter::testCaseEnded ( TestCaseStats const & testCaseStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 109 of file catch_reporter_listening.cpp.

109 {
110 for ( auto const& listener : m_listeners ) {
111 listener->testCaseEnded( testCaseStats );
112 }
113 m_reporter->testCaseEnded( testCaseStats );
114 }

◆ testCaseStarting()

void Catch::ListeningReporter::testCaseStarting ( TestCaseInfo const & testInfo)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 73 of file catch_reporter_listening.cpp.

73 {
74 for ( auto const& listener : m_listeners ) {
75 listener->testCaseStarting( testInfo );
76 }
77 m_reporter->testCaseStarting( testInfo );
78 }

◆ testGroupEnded()

void Catch::ListeningReporter::testGroupEnded ( TestGroupStats const & testGroupStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 116 of file catch_reporter_listening.cpp.

116 {
117 for ( auto const& listener : m_listeners ) {
118 listener->testGroupEnded( testGroupStats );
119 }
120 m_reporter->testGroupEnded( testGroupStats );
121 }

◆ testGroupStarting()

void Catch::ListeningReporter::testGroupStarting ( GroupInfo const & groupInfo)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 65 of file catch_reporter_listening.cpp.

65 {
66 for ( auto const& listener : m_listeners ) {
67 listener->testGroupStarting( groupInfo );
68 }
69 m_reporter->testGroupStarting( groupInfo );
70 }

◆ testRunEnded()

void Catch::ListeningReporter::testRunEnded ( TestRunStats const & testRunStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 123 of file catch_reporter_listening.cpp.

123 {
124 for ( auto const& listener : m_listeners ) {
125 listener->testRunEnded( testRunStats );
126 }
127 m_reporter->testRunEnded( testRunStats );
128 }

◆ testRunStarting()

void Catch::ListeningReporter::testRunStarting ( TestRunInfo const & testRunInfo)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 58 of file catch_reporter_listening.cpp.

58 {
59 for ( auto const& listener : m_listeners ) {
60 listener->testRunStarting( testRunInfo );
61 }
62 m_reporter->testRunStarting( testRunInfo );
63 }

The documentation for this class was generated from the following files: