MCPcopy Create free account
hub / github.com/FidoProject/Fido / CompactReporter

Class CompactReporter

tests/catch.h:9909–10186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9907namespace Catch {
9908
9909 struct CompactReporter : StreamingReporterBase {
9910
9911 CompactReporter( ReporterConfig const& _config )
9912 : StreamingReporterBase( _config )
9913 {}
9914
9915 virtual ~CompactReporter();
9916
9917 static std::string getDescription() {
9918 return "Reports test results on a single line, suitable for IDEs";
9919 }
9920
9921 virtual ReporterPreferences getPreferences() const {
9922 ReporterPreferences prefs;
9923 prefs.shouldRedirectStdOut = false;
9924 return prefs;
9925 }
9926
9927 virtual void noMatchingTestCases( std::string const& spec ) {
9928 stream << "No test cases matched '" << spec << "'" << std::endl;
9929 }
9930
9931 virtual void assertionStarting( AssertionInfo const& ) {
9932 }
9933
9934 virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
9935 AssertionResult const& result = _assertionStats.assertionResult;
9936
9937 bool printInfoMessages = true;
9938
9939 // Drop out if result was successful and we're not printing those
9940 if( !m_config->includeSuccessfulResults() && result.isOk() ) {
9941 if( result.getResultType() != ResultWas::Warning )
9942 return false;
9943 printInfoMessages = false;
9944 }
9945
9946 AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
9947 printer.print();
9948
9949 stream << std::endl;
9950 return true;
9951 }
9952
9953 virtual void testRunEnded( TestRunStats const& _testRunStats ) {
9954 printTotals( _testRunStats.totals );
9955 stream << "\n" << std::endl;
9956 StreamingReporterBase::testRunEnded( _testRunStats );
9957 }
9958
9959 private:
9960 class AssertionPrinter {
9961 void operator= ( AssertionPrinter const& );
9962 public:
9963 AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages )
9964 : stream( _stream )
9965 , stats( _stats )
9966 , result( _stats.assertionResult )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected