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

summaryrefslogtreecommitdiffhomepage
path: root/include/reporters/catch_reporter_multi.cpp
blob: 017b628d1f0249ff3697a674e923754fa0973227 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
 *  Created by Phil on 5/08/2015.
 *  Copyright 2015 Two Blue Cubes Ltd. All rights reserved.
 *
 *  Distributed under the Boost Software License, Version 1.0. (See accompanying
 *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 */

 #include "catch_reporter_multi.h"

namespace Catch {

    void MultipleReporters::add( IStreamingReporterPtr&& reporter ) {
        m_reporters.push_back( std::move( reporter ) );
    }

    ReporterPreferences MultipleReporters::getPreferences() const {
        return m_reporters[0]->getPreferences();
    }

    std::set<Verbosity> MultipleReporters::getSupportedVerbosities() {
        return std::set<Verbosity>{ };
    }


    void MultipleReporters::noMatchingTestCases( std::string const& spec ) {
        for( auto const& reporter : m_reporters )
            reporter->noMatchingTestCases( spec );
    }


    void MultipleReporters::testRunStarting( TestRunInfo const& testRunInfo ) {
        for( auto const& reporter : m_reporters )
            reporter->testRunStarting( testRunInfo );
    }

    void MultipleReporters::testGroupStarting( GroupInfo const& groupInfo ) {
        for( auto const& reporter : m_reporters )
            reporter->testGroupStarting( groupInfo );
    }


    void MultipleReporters::testCaseStarting( TestCaseInfo const& testInfo ) {
        for( auto const& reporter : m_reporters )
            reporter->testCaseStarting( testInfo );
    }

    void MultipleReporters::sectionStarting( SectionInfo const& sectionInfo ) {
        for( auto const& reporter : m_reporters )
            reporter->sectionStarting( sectionInfo );
    }

    void MultipleReporters::assertionStarting( AssertionInfo const& assertionInfo ) {
        for( auto const& reporter : m_reporters )
            reporter->assertionStarting( assertionInfo );
    }

    // The return value indicates if the messages buffer should be cleared:
    bool MultipleReporters::assertionEnded( AssertionStats const& assertionStats ) {
        bool clearBuffer = false;
        for( auto const& reporter : m_reporters )
            clearBuffer |= reporter->assertionEnded( assertionStats );
        return clearBuffer;
    }

    void MultipleReporters::sectionEnded( SectionStats const& sectionStats ) {
        for( auto const& reporter : m_reporters )
            reporter->sectionEnded( sectionStats );
    }

    void MultipleReporters::testCaseEnded( TestCaseStats const& testCaseStats ) {
        for( auto const& reporter : m_reporters )
            reporter->testCaseEnded( testCaseStats );
    }

    void MultipleReporters::testGroupEnded( TestGroupStats const& testGroupStats ) {
        for( auto const& reporter : m_reporters )
            reporter->testGroupEnded( testGroupStats );
    }

    void MultipleReporters::testRunEnded( TestRunStats const& testRunStats ) {
        for( auto const& reporter : m_reporters )
            reporter->testRunEnded( testRunStats );
    }


    void MultipleReporters::skipTest( TestCaseInfo const& testInfo ) {
        for( auto const& reporter : m_reporters )
            reporter->skipTest( testInfo );
    }

    bool MultipleReporters::isMulti() const {
        return true;
    }

} // end namespace Catch