| 4908 | |
| 4909 | template<typename DerivedT> |
| 4910 | struct CumulativeReporterBase : IStreamingReporter { |
| 4911 | template<typename T, typename ChildNodeT> |
| 4912 | struct Node { |
| 4913 | explicit Node( T const& _value ) : value( _value ) {} |
| 4914 | virtual ~Node() {} |
| 4915 | |
| 4916 | using ChildNodes = std::vector<std::shared_ptr<ChildNodeT>>; |
| 4917 | T value; |
| 4918 | ChildNodes children; |
| 4919 | }; |
| 4920 | struct SectionNode { |
| 4921 | explicit SectionNode(SectionStats const& _stats) : stats(_stats) {} |
| 4922 | virtual ~SectionNode() = default; |
| 4923 | |
| 4924 | bool operator == (SectionNode const& other) const { |
| 4925 | return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo; |
| 4926 | } |
| 4927 | bool operator == (std::shared_ptr<SectionNode> const& other) const { |
| 4928 | return operator==(*other); |
| 4929 | } |
| 4930 | |
| 4931 | SectionStats stats; |
| 4932 | using ChildSections = std::vector<std::shared_ptr<SectionNode>>; |
| 4933 | using Assertions = std::vector<AssertionStats>; |
| 4934 | ChildSections childSections; |
| 4935 | Assertions assertions; |
| 4936 | std::string stdOut; |
| 4937 | std::string stdErr; |
| 4938 | }; |
| 4939 | |
| 4940 | struct BySectionInfo { |
| 4941 | BySectionInfo( SectionInfo const& other ) : m_other( other ) {} |
| 4942 | BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {} |
| 4943 | bool operator() (std::shared_ptr<SectionNode> const& node) const { |
| 4944 | return ((node->stats.sectionInfo.name == m_other.name) && |
| 4945 | (node->stats.sectionInfo.lineInfo == m_other.lineInfo)); |
| 4946 | } |
| 4947 | void operator=(BySectionInfo const&) = delete; |
| 4948 | |
| 4949 | private: |
| 4950 | SectionInfo const& m_other; |
| 4951 | }; |
| 4952 | |
| 4953 | using TestCaseNode = Node<TestCaseStats, SectionNode>; |
| 4954 | using TestGroupNode = Node<TestGroupStats, TestCaseNode>; |
| 4955 | using TestRunNode = Node<TestRunStats, TestGroupNode>; |
| 4956 | |
| 4957 | CumulativeReporterBase( ReporterConfig const& _config ) |
| 4958 | : m_config( _config.fullConfig() ), |
| 4959 | stream( _config.stream() ) |
| 4960 | { |
| 4961 | m_reporterPrefs.shouldRedirectStdOut = false; |
| 4962 | if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) ) |
| 4963 | CATCH_ERROR( "Verbosity level not supported by this reporter" ); |
| 4964 | } |
| 4965 | ~CumulativeReporterBase() override = default; |
| 4966 | |
| 4967 | ReporterPreferences getPreferences() const override { |
nothing calls this directly
no outgoing calls
no test coverage detected