File indexing completed on 2025-01-18 09:54:07
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
0009 #define CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
0010
0011 #include <catch2/reporters/catch_reporter_common_base.hpp>
0012 #include <catch2/internal/catch_move_and_forward.hpp>
0013
0014 #include <vector>
0015
0016 namespace Catch {
0017
0018 class StreamingReporterBase : public ReporterBase {
0019 public:
0020
0021
0022 StreamingReporterBase(ReporterConfig&& _config):
0023 ReporterBase(CATCH_MOVE(_config))
0024 {}
0025 ~StreamingReporterBase() override;
0026
0027 void benchmarkPreparing( StringRef ) override {}
0028 void benchmarkStarting( BenchmarkInfo const& ) override {}
0029 void benchmarkEnded( BenchmarkStats<> const& ) override {}
0030 void benchmarkFailed( StringRef ) override {}
0031
0032 void fatalErrorEncountered( StringRef ) override {}
0033 void noMatchingTestCases( StringRef ) override {}
0034 void reportInvalidTestSpec( StringRef ) override {}
0035
0036 void testRunStarting( TestRunInfo const& _testRunInfo ) override;
0037
0038 void testCaseStarting(TestCaseInfo const& _testInfo) override {
0039 currentTestCaseInfo = &_testInfo;
0040 }
0041 void testCasePartialStarting( TestCaseInfo const&, uint64_t ) override {}
0042 void sectionStarting(SectionInfo const& _sectionInfo) override {
0043 m_sectionStack.push_back(_sectionInfo);
0044 }
0045
0046 void assertionStarting( AssertionInfo const& ) override {}
0047 void assertionEnded( AssertionStats const& ) override {}
0048
0049 void sectionEnded(SectionStats const& ) override {
0050 m_sectionStack.pop_back();
0051 }
0052 void testCasePartialEnded( TestCaseStats const&, uint64_t ) override {}
0053 void testCaseEnded(TestCaseStats const& ) override {
0054 currentTestCaseInfo = nullptr;
0055 }
0056 void testRunEnded( TestRunStats const& ) override;
0057
0058 void skipTest(TestCaseInfo const&) override {
0059
0060
0061 }
0062
0063 protected:
0064 TestRunInfo currentTestRunInfo{ "test run has not started yet"_sr };
0065 TestCaseInfo const* currentTestCaseInfo = nullptr;
0066
0067
0068 std::vector<SectionInfo> m_sectionStack;
0069 };
0070
0071 }
0072
0073 #endif