Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 10:10:48

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_REPORTER_CONSOLE_HPP_INCLUDED
0009 #define CATCH_REPORTER_CONSOLE_HPP_INCLUDED
0010 
0011 #include <catch2/reporters/catch_reporter_streaming_base.hpp>
0012 #include <catch2/internal/catch_unique_ptr.hpp>
0013 
0014 namespace Catch {
0015     // Fwd decls
0016     class TablePrinter;
0017 
0018     class ConsoleReporter final : public StreamingReporterBase {
0019         Detail::unique_ptr<TablePrinter> m_tablePrinter;
0020 
0021     public:
0022         ConsoleReporter(ReporterConfig&& config);
0023         ~ConsoleReporter() override;
0024         static std::string getDescription();
0025 
0026         void noMatchingTestCases( StringRef unmatchedSpec ) override;
0027         void reportInvalidTestSpec( StringRef arg ) override;
0028 
0029         void assertionStarting(AssertionInfo const&) override;
0030 
0031         void assertionEnded(AssertionStats const& _assertionStats) override;
0032 
0033         void sectionStarting(SectionInfo const& _sectionInfo) override;
0034         void sectionEnded(SectionStats const& _sectionStats) override;
0035 
0036         void benchmarkPreparing( StringRef name ) override;
0037         void benchmarkStarting(BenchmarkInfo const& info) override;
0038         void benchmarkEnded(BenchmarkStats<> const& stats) override;
0039         void benchmarkFailed( StringRef error ) override;
0040 
0041         void testCaseEnded(TestCaseStats const& _testCaseStats) override;
0042         void testRunEnded(TestRunStats const& _testRunStats) override;
0043         void testRunStarting(TestRunInfo const& _testRunInfo) override;
0044 
0045     private:
0046         void lazyPrint();
0047 
0048         void lazyPrintWithoutClosingBenchmarkTable();
0049         void lazyPrintRunInfo();
0050         void printTestCaseAndSectionHeader();
0051 
0052         void printClosedHeader(std::string const& _name);
0053         void printOpenHeader(std::string const& _name);
0054 
0055         // if string has a : in first line will set indent to follow it on
0056         // subsequent lines
0057         void printHeaderString(std::string const& _string, std::size_t indent = 0);
0058 
0059         void printTotalsDivider(Totals const& totals);
0060 
0061         bool m_headerPrinted = false;
0062         bool m_testRunInfoPrinted = false;
0063     };
0064 
0065 } // end namespace Catch
0066 
0067 #endif // CATCH_REPORTER_CONSOLE_HPP_INCLUDED