Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Catch::CompactReporter Struct Reference

#include <catch_reporter_compact.h>

Inheritance diagram for Catch::CompactReporter:
Collaboration diagram for Catch::CompactReporter:

Public Member Functions

 ~CompactReporter () override
 
ReporterPreferences getPreferences () const override
 
void noMatchingTestCases (std::string const &spec) override
 
void assertionStarting (AssertionInfo const &) override
 
bool assertionEnded (AssertionStats const &_assertionStats) override
 
void sectionEnded (SectionStats const &_sectionStats) override
 
void testRunEnded (TestRunStats const &_testRunStats) override
 
 StreamingReporterBase (ReporterConfig const &_config)
 
- Public Member Functions inherited from Catch::StreamingReporterBase< CompactReporter >
 StreamingReporterBase (ReporterConfig const &_config)
 
ReporterPreferences getPreferences () const override
 
 ~StreamingReporterBase () override=default
 
void noMatchingTestCases (std::string const &) 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 sectionEnded (SectionStats const &) override
 
void testCaseEnded (TestCaseStats const &) override
 
void testGroupEnded (TestGroupStats const &) override
 
void testRunEnded (TestRunStats const &) override
 
void skipTest (TestCaseInfo const &) override
 
- Public Member Functions inherited from Catch::IStreamingReporter
virtual ~IStreamingReporter ()=default
 
virtual void benchmarkStarting (BenchmarkInfo const &)
 
virtual void benchmarkEnded (BenchmarkStats const &)
 
virtual void fatalErrorEncountered (StringRef name)
 
virtual bool isMulti () const
 

Static Public Member Functions

static std::string getDescription ()
 
- Static Public Member Functions inherited from Catch::StreamingReporterBase< CompactReporter >
static std::set< VerbositygetSupportedVerbosities ()
 

Additional Inherited Members

- Public Attributes inherited from Catch::StreamingReporterBase< CompactReporter >
IConfigPtr m_config
 
std::ostream & stream
 
LazyStat< TestRunInfocurrentTestRunInfo
 
LazyStat< GroupInfocurrentGroupInfo
 
LazyStat< TestCaseInfocurrentTestCaseInfo
 
std::vector< SectionInfom_sectionStack
 
ReporterPreferences m_reporterPrefs
 

Detailed Description

Definition at line 17 of file catch_reporter_compact.h.

Constructor & Destructor Documentation

◆ ~CompactReporter()

Catch::CompactReporter::~CompactReporter ( )
override

Definition at line 288 of file catch_reporter_compact.cpp.

288{}

Member Function Documentation

◆ assertionEnded()

bool Catch::CompactReporter::assertionEnded ( AssertionStats const & _assertionStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 257 of file catch_reporter_compact.cpp.

257 {
258 AssertionResult const& result = _assertionStats.assertionResult;
259
260 bool printInfoMessages = true;
261
262 // Drop out if result was successful and we're not printing those
263 if( !m_config->includeSuccessfulResults() && result.isOk() ) {
264 if( result.getResultType() != ResultWas::Warning )
265 return false;
266 printInfoMessages = false;
267 }
268
269 AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
270 printer.print();
271
272 stream << std::endl;
273 return true;
274 }

◆ assertionStarting()

void Catch::CompactReporter::assertionStarting ( AssertionInfo const & )
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 255 of file catch_reporter_compact.cpp.

255{}

◆ getDescription()

std::string Catch::CompactReporter::getDescription ( )
static

Definition at line 243 of file catch_reporter_compact.cpp.

243 {
244 return "Reports test results on a single line, suitable for IDEs";
245 }

◆ getPreferences()

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

Implements Catch::IStreamingReporter.

Definition at line 247 of file catch_reporter_compact.cpp.

247 {
248 return m_reporterPrefs;
249 }

◆ noMatchingTestCases()

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

Implements Catch::IStreamingReporter.

Definition at line 251 of file catch_reporter_compact.cpp.

251 {
252 stream << "No test cases matched '" << spec << '\'' << std::endl;
253 }

◆ sectionEnded()

void Catch::CompactReporter::sectionEnded ( SectionStats const & _sectionStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 276 of file catch_reporter_compact.cpp.

276 {
277 if (m_config->showDurations() == ShowDurations::Always) {
278 stream << getFormattedDuration(_sectionStats.durationInSeconds) << " s: " << _sectionStats.sectionInfo.name << std::endl;
279 }
280 }
std::string getFormattedDuration(double duration)
Here is the call graph for this function:

◆ StreamingReporterBase()

Catch::StreamingReporterBase< DerivedT >::StreamingReporterBase ( ReporterConfig const & _config)
inline

Definition at line 33 of file catch_reporter_bases.hpp.

34 : m_config( _config.fullConfig() ),
35 stream( _config.stream() )
36 {
38 if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
39 CATCH_ERROR( "Verbosity level not supported by this reporter" );
40 }
#define CATCH_ERROR(msg)
int * count

◆ testRunEnded()

void Catch::CompactReporter::testRunEnded ( TestRunStats const & _testRunStats)
overridevirtual

Implements Catch::IStreamingReporter.

Definition at line 282 of file catch_reporter_compact.cpp.

282 {
283 printTotals( stream, _testRunStats.totals );
284 stream << '\n' << std::endl;
286 }
void testRunEnded(TestRunStats const &) override
Here is the call graph for this function:

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