mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
Fix Listening reporter use of ReporterPreferences
This commit is contained in:
parent
797d3b04df
commit
12a8dfa2f2
@ -11,6 +11,11 @@
|
|||||||
|
|
||||||
namespace Catch {
|
namespace Catch {
|
||||||
|
|
||||||
|
ListeningReporter::ListeningReporter() {
|
||||||
|
// We will assume that listeners will always want all assertions
|
||||||
|
m_preferences.shouldReportAllAssertions = true;
|
||||||
|
}
|
||||||
|
|
||||||
void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) {
|
void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) {
|
||||||
m_listeners.push_back( std::move( listener ) );
|
m_listeners.push_back( std::move( listener ) );
|
||||||
}
|
}
|
||||||
@ -18,10 +23,11 @@ namespace Catch {
|
|||||||
void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) {
|
void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) {
|
||||||
assert(!m_reporter && "Listening reporter can wrap only 1 real reporter");
|
assert(!m_reporter && "Listening reporter can wrap only 1 real reporter");
|
||||||
m_reporter = std::move( reporter );
|
m_reporter = std::move( reporter );
|
||||||
|
m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReporterPreferences ListeningReporter::getPreferences() const {
|
ReporterPreferences ListeningReporter::getPreferences() const {
|
||||||
return m_reporter->getPreferences();
|
return m_preferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<Verbosity> ListeningReporter::getSupportedVerbosities() {
|
std::set<Verbosity> ListeningReporter::getSupportedVerbosities() {
|
||||||
|
@ -15,8 +15,11 @@ namespace Catch {
|
|||||||
using Reporters = std::vector<IStreamingReporterPtr>;
|
using Reporters = std::vector<IStreamingReporterPtr>;
|
||||||
Reporters m_listeners;
|
Reporters m_listeners;
|
||||||
IStreamingReporterPtr m_reporter = nullptr;
|
IStreamingReporterPtr m_reporter = nullptr;
|
||||||
|
ReporterPreferences m_preferences;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
ListeningReporter();
|
||||||
|
|
||||||
void addListener( IStreamingReporterPtr&& listener );
|
void addListener( IStreamingReporterPtr&& listener );
|
||||||
void addReporter( IStreamingReporterPtr&& reporter );
|
void addReporter( IStreamingReporterPtr&& reporter );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user