Check that reporter supports requested verbosity

This commit is contained in:
Baruch Burstein
2017-07-06 01:25:49 +03:00
parent bb9f2bb3ad
commit f749347523
5 changed files with 35 additions and 2 deletions

View File

@@ -49,12 +49,18 @@ namespace Catch {
stream( _config.stream() )
{
m_reporterPrefs.shouldRedirectStdOut = false;
CATCH_ENFORCE( getSupportedVerbosities().count( m_config->verbosity() ), "Verbosity level not supported by this reporter" );
}
virtual ReporterPreferences getPreferences() const override {
return m_reporterPrefs;
}
virtual std::set<Verbosity> const& getSupportedVerbosities() const override {
static std::set<Verbosity> supported{ Verbosity::Normal };
return supported;
}
virtual ~StreamingReporterBase() override;
virtual void noMatchingTestCases( std::string const& ) override {}
@@ -155,6 +161,7 @@ namespace Catch {
stream( _config.stream() )
{
m_reporterPrefs.shouldRedirectStdOut = false;
CATCH_ENFORCE( getSupportedVerbosities().count( m_config->verbosity() ), "Verbosity level not supported by this reporter" );
}
~CumulativeReporterBase();
@@ -162,6 +169,11 @@ namespace Catch {
return m_reporterPrefs;
}
virtual std::set<Verbosity> const& getSupportedVerbosities() const override {
static std::set<Verbosity> supported{ Verbosity::Normal };
return supported;
}
virtual void testRunStarting( TestRunInfo const& ) override {}
virtual void testGroupStarting( GroupInfo const& ) override {}