File indexing completed on 2025-01-18 09:54:07
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CATCH_REPORTER_MULTI_HPP_INCLUDED
0009 #define CATCH_REPORTER_MULTI_HPP_INCLUDED
0010
0011 #include <catch2/interfaces/catch_interfaces_reporter.hpp>
0012
0013 namespace Catch {
0014
0015 class MultiReporter final : public IEventListener {
0016
0017
0018
0019
0020
0021
0022 std::vector<IEventListenerPtr> m_reporterLikes;
0023 bool m_haveNoncapturingReporters = false;
0024
0025
0026
0027 size_t m_insertedListeners = 0;
0028
0029 void updatePreferences(IEventListener const& reporterish);
0030
0031 public:
0032 using IEventListener::IEventListener;
0033
0034 void addListener( IEventListenerPtr&& listener );
0035 void addReporter( IEventListenerPtr&& reporter );
0036
0037 public:
0038
0039 void noMatchingTestCases( StringRef unmatchedSpec ) override;
0040 void fatalErrorEncountered( StringRef error ) override;
0041 void reportInvalidTestSpec( StringRef arg ) override;
0042
0043 void benchmarkPreparing( StringRef name ) override;
0044 void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override;
0045 void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override;
0046 void benchmarkFailed( StringRef error ) override;
0047
0048 void testRunStarting( TestRunInfo const& testRunInfo ) override;
0049 void testCaseStarting( TestCaseInfo const& testInfo ) override;
0050 void testCasePartialStarting(TestCaseInfo const& testInfo, uint64_t partNumber) override;
0051 void sectionStarting( SectionInfo const& sectionInfo ) override;
0052 void assertionStarting( AssertionInfo const& assertionInfo ) override;
0053
0054 void assertionEnded( AssertionStats const& assertionStats ) override;
0055 void sectionEnded( SectionStats const& sectionStats ) override;
0056 void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override;
0057 void testCaseEnded( TestCaseStats const& testCaseStats ) override;
0058 void testRunEnded( TestRunStats const& testRunStats ) override;
0059
0060 void skipTest( TestCaseInfo const& testInfo ) override;
0061
0062 void listReporters(std::vector<ReporterDescription> const& descriptions) override;
0063 void listListeners(std::vector<ListenerDescription> const& descriptions) override;
0064 void listTests(std::vector<TestCaseHandle> const& tests) override;
0065 void listTags(std::vector<TagInfo> const& tags) override;
0066
0067
0068 };
0069
0070 }
0071
0072 #endif