diff options
| author | Martin Hořeňovský | 2019-06-17 14:43:10 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2019-10-29 14:07:18 +0100 |
| commit | 0f39438aaefe70a89aaee65e8ce78c490a6b03b5 (patch) | |
| tree | feb4e91f2d2db00ae85a922507663ff3e295f7a5 | |
| parent | c582e351ce8420cc74c84abf0a797a3663bf06ea (diff) | |
| download | catch3-0f39438aaefe70a89aaee65e8ce78c490a6b03b5.tar.gz | |
Stop checking verbosities up-front
| -rw-r--r-- | docs/deprecations.md | 12 | ||||
| -rw-r--r-- | include/internal/catch_interfaces_reporter.h | 1 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_bases.cpp | 4 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_bases.hpp | 14 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_listening.cpp | 5 | ||||
| -rw-r--r-- | include/reporters/catch_reporter_listening.h | 4 |
6 files changed, 1 insertions, 39 deletions
diff --git a/docs/deprecations.md b/docs/deprecations.md index 42f7a073..366d6426 100644 --- a/docs/deprecations.md +++ b/docs/deprecations.md @@ -29,18 +29,6 @@ method will be removed. ## Planned changes - -### Reporter verbosities - -The current implementation of verbosities, where the reporter is checked -up-front whether it supports the requested verbosity, is fundamentally -misguided and will be changed. The new implementation will no longer check -whether the specified reporter supports the requested verbosity, instead -it will be up to the reporters to deal with verbosities as they see fit -(with an expectation that unsupported verbosities will be, at most, -warnings, but not errors). - - ### Output format of `--list-*` command line parameters The various list operations will be piped through reporters. This means diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h index 751ef2c2..9c2b0267 100644 --- a/include/internal/catch_interfaces_reporter.h +++ b/include/internal/catch_interfaces_reporter.h @@ -208,7 +208,6 @@ namespace Catch { // Implementing class must also provide the following static methods: // static std::string getDescription(); - // static std::set<Verbosity> getSupportedVerbosities() virtual ReporterPreferences getPreferences() const = 0; diff --git a/include/reporters/catch_reporter_bases.cpp b/include/reporters/catch_reporter_bases.cpp index fcbafef5..ae704ab2 100644 --- a/include/reporters/catch_reporter_bases.cpp +++ b/include/reporters/catch_reporter_bases.cpp @@ -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 &) { diff --git a/include/reporters/catch_reporter_bases.hpp b/include/reporters/catch_reporter_bases.hpp index 66a891ff..7bedd086 100644 --- a/include/reporters/catch_reporter_bases.hpp +++ b/include/reporters/catch_reporter_bases.hpp @@ -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; }; diff --git a/include/reporters/catch_reporter_listening.cpp b/include/reporters/catch_reporter_listening.cpp index 91e6b39a..32ee54ac 100644 --- a/include/reporters/catch_reporter_listening.cpp +++ b/include/reporters/catch_reporter_listening.cpp @@ -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 ); diff --git a/include/reporters/catch_reporter_listening.h b/include/reporters/catch_reporter_listening.h index bfaa3085..7fbd7af5 100644 --- a/include/reporters/catch_reporter_listening.h +++ b/include/reporters/catch_reporter_listening.h @@ -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; |