Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-11-14 11:22:29 +0100
committerMartin Hořeňovský2021-11-14 11:41:24 +0100
commitb892ab133c32d7fd82290467b46ba3c4a32527ae (patch)
treed4ca078f282ab5b92aa77964c7dfb36804db9d9a /src/catch2
parent0c9fe16537cdda0deecf9a6d788358c380b9e174 (diff)
downloadcatch3-b892ab133c32d7fd82290467b46ba3c4a32527ae.tar.gz
Cleanup visibility in CumulativeReporterBase
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.cpp6
-rw-r--r--src/catch2/reporters/catch_reporter_cumulative_base.hpp18
2 files changed, 15 insertions, 9 deletions
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<ReporterDescription> const& descriptions) {
- defaultListReporters(stream, descriptions, m_config->verbosity());
+ defaultListReporters(m_stream, descriptions, m_config->verbosity());
}
void CumulativeReporterBase::listTests(std::vector<TestCaseHandle> const& tests) {
- defaultListTests(stream,
+ defaultListTests(m_stream,
tests,
m_config->hasTestFilters(),
m_config->verbosity());
}
void CumulativeReporterBase::listTags(std::vector<TagInfo> 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<typename T, typename ChildNodeT>
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;
- // Note: We rely on pointer identity being stable, which is why
- // we store pointers to the nodes rather than the values.
- std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases;
// 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<TestRunNode> 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<Detail::unique_ptr<TestCaseNode>> m_testCases;
+ // Root section of the _current_ test case
Detail::unique_ptr<SectionNode> m_rootSection;
+ // Deepest section of the _current_ test case
SectionNode* m_deepestSection = nullptr;
+ // Stack of _active_ sections in the _current_ test case
std::vector<SectionNode*> m_sectionStack;
};