mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-03 21:49:32 +01:00 
			
		
		
		
	Stop checking verbosities up-front
This commit is contained in:
		@@ -59,10 +59,6 @@ namespace Catch {
 | 
			
		||||
    TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config)
 | 
			
		||||
        :StreamingReporterBase(_config) {}
 | 
			
		||||
 | 
			
		||||
    std::set<Verbosity> TestEventListenerBase::getSupportedVerbosities() {
 | 
			
		||||
        return { Verbosity::Quiet, Verbosity::Normal, Verbosity::High };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void TestEventListenerBase::assertionStarting(AssertionInfo const &) {}
 | 
			
		||||
 | 
			
		||||
    bool TestEventListenerBase::assertionEnded(AssertionStats const &) {
 | 
			
		||||
 
 | 
			
		||||
@@ -35,18 +35,12 @@ namespace Catch {
 | 
			
		||||
            stream( _config.stream() )
 | 
			
		||||
        {
 | 
			
		||||
            m_reporterPrefs.shouldRedirectStdOut = false;
 | 
			
		||||
            if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
 | 
			
		||||
                CATCH_ERROR( "Verbosity level not supported by this reporter" );
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ReporterPreferences getPreferences() const override {
 | 
			
		||||
            return m_reporterPrefs;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        static std::set<Verbosity> getSupportedVerbosities() {
 | 
			
		||||
            return { Verbosity::Normal };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        ~StreamingReporterBase() override = default;
 | 
			
		||||
 | 
			
		||||
        void noMatchingTestCases(std::string const&) override {}
 | 
			
		||||
@@ -153,8 +147,6 @@ namespace Catch {
 | 
			
		||||
            stream( _config.stream() )
 | 
			
		||||
        {
 | 
			
		||||
            m_reporterPrefs.shouldRedirectStdOut = false;
 | 
			
		||||
            if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
 | 
			
		||||
                CATCH_ERROR( "Verbosity level not supported by this reporter" );
 | 
			
		||||
        }
 | 
			
		||||
        ~CumulativeReporterBase() override = default;
 | 
			
		||||
 | 
			
		||||
@@ -162,10 +154,6 @@ namespace Catch {
 | 
			
		||||
            return m_reporterPrefs;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        static std::set<Verbosity> getSupportedVerbosities() {
 | 
			
		||||
            return { Verbosity::Normal };
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        void testRunStarting( TestRunInfo const& ) override {}
 | 
			
		||||
        void testGroupStarting( GroupInfo const& ) override {}
 | 
			
		||||
 | 
			
		||||
@@ -271,8 +259,6 @@ namespace Catch {
 | 
			
		||||
    struct TestEventListenerBase : StreamingReporterBase<TestEventListenerBase> {
 | 
			
		||||
        TestEventListenerBase( ReporterConfig const& _config );
 | 
			
		||||
 | 
			
		||||
        static std::set<Verbosity> getSupportedVerbosities();
 | 
			
		||||
 | 
			
		||||
        void assertionStarting(AssertionInfo const&) override;
 | 
			
		||||
        bool assertionEnded(AssertionStats const&) override;
 | 
			
		||||
    };
 | 
			
		||||
 
 | 
			
		||||
@@ -30,11 +30,6 @@ namespace Catch {
 | 
			
		||||
        return m_preferences;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    std::set<Verbosity> ListeningReporter::getSupportedVerbosities() {
 | 
			
		||||
        return std::set<Verbosity>{ };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    void ListeningReporter::noMatchingTestCases( std::string const& spec ) {
 | 
			
		||||
        for ( auto const& listener : m_listeners ) {
 | 
			
		||||
            listener->noMatchingTestCases( spec );
 | 
			
		||||
 
 | 
			
		||||
@@ -28,10 +28,8 @@ namespace Catch {
 | 
			
		||||
        ReporterPreferences getPreferences() const override;
 | 
			
		||||
 | 
			
		||||
        void noMatchingTestCases( std::string const& spec ) override;
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        void reportInvalidArguments(std::string const&arg) override;
 | 
			
		||||
        
 | 
			
		||||
        static std::set<Verbosity> getSupportedVerbosities();
 | 
			
		||||
 | 
			
		||||
#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
 | 
			
		||||
        void benchmarkPreparing(std::string const& name) override;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user