diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/src/catch2/reporters/catch_reporter_cumulative_base.cpp index 85e9c156..9dd1eb78 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -146,18 +146,18 @@ namespace Catch { } void CumulativeReporterBase::listReporters(std::vector const& descriptions) { - defaultListReporters(stream, descriptions, m_config->verbosity()); + defaultListReporters(m_stream, descriptions, m_config->verbosity()); } void CumulativeReporterBase::listTests(std::vector const& tests) { - defaultListTests(stream, + defaultListTests(m_stream, tests, m_config->hasTestFilters(), m_config->verbosity()); } void CumulativeReporterBase::listTags(std::vector const& tags) { - defaultListTags( stream, tags, m_config->hasTestFilters() ); + defaultListTags( m_stream, tags, m_config->hasTestFilters() ); } bool CumulativeReporterBase::SectionNode::hasAnyAssertions() const { diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp index 55abd1e1..732a9469 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp @@ -59,7 +59,8 @@ namespace Catch { * performance. **Accessing the assertion expansions if it wasn't stored is * UB.** */ - struct CumulativeReporterBase : IStreamingReporter { + class CumulativeReporterBase : public IStreamingReporter { + public: template struct Node { explicit Node( T const& _value ) : value( _value ) {} @@ -90,7 +91,7 @@ namespace Catch { CumulativeReporterBase( ReporterConfig const& _config ): IStreamingReporter( _config.fullConfig() ), - stream( _config.stream() ) {} + m_stream( _config.stream() ) {} ~CumulativeReporterBase() override; void benchmarkPreparing( StringRef ) override {} @@ -131,17 +132,22 @@ namespace Catch { bool m_shouldStoreFailedAssertions = true; //! Stream to write the output to - std::ostream& stream; + std::ostream& m_stream; + // We need lazy construction here. We should probably refactor it + // later, after the events are redone. + //! The root node of the test run tree. + Detail::unique_ptr m_testRun; + + private: // Note: We rely on pointer identity being stable, which is why // we store pointers to the nodes rather than the values. std::vector> m_testCases; - // We need lazy construction here. We should probably refactor it - // later, after the events are redone. - Detail::unique_ptr m_testRun; - + // Root section of the _current_ test case Detail::unique_ptr m_rootSection; + // Deepest section of the _current_ test case SectionNode* m_deepestSection = nullptr; + // Stack of _active_ sections in the _current_ test case std::vector m_sectionStack; };