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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-04-10 21:50:30 +0200
committerMartin Hořeňovský2022-04-10 21:50:51 +0200
commit4e006a93ffbce660c73f3bcd503513bac03050e5 (patch)
treec075282d1f4523feb12c84dc32c67a4e43c295d0
parent73d8fb5bca1e428764a0c49c3efb9455d77f9d4d (diff)
downloadcatch3-4e006a93ffbce660c73f3bcd503513bac03050e5.tar.gz
Rename IStreamingReporterPtr => IEventListenerPtr
This reflects the renaming of the reporter/listener base class.
-rw-r--r--src/catch2/catch_session.cpp6
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.hpp2
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter_factory.hpp6
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter_registry.hpp4
-rw-r--r--src/catch2/internal/catch_reporter_registry.cpp2
-rw-r--r--src/catch2/internal/catch_reporter_registry.hpp2
-rw-r--r--src/catch2/internal/catch_run_context.cpp2
-rw-r--r--src/catch2/internal/catch_run_context.hpp4
-rw-r--r--src/catch2/reporters/catch_reporter_multi.cpp4
-rw-r--r--src/catch2/reporters/catch_reporter_multi.hpp6
-rw-r--r--src/catch2/reporters/catch_reporter_registrars.hpp6
-rw-r--r--tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp2
12 files changed, 23 insertions, 23 deletions
diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp
index 86295844..5af8f454 100644
--- a/src/catch2/catch_session.cpp
+++ b/src/catch2/catch_session.cpp
@@ -34,14 +34,14 @@ namespace Catch {
namespace {
const int MaxExitCode = 255;
- IStreamingReporterPtr createReporter(std::string const& reporterName, ReporterConfig const& config) {
+ IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig const& config) {
auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config);
CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << '\'');
return reporter;
}
- IStreamingReporterPtr prepareReporters(Config const* config) {
+ IEventListenerPtr prepareReporters(Config const* config) {
if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()
&& config->getReporterSpecs().size() == 1) {
auto const& spec = config->getReporterSpecs()[0];
@@ -80,7 +80,7 @@ namespace Catch {
class TestGroup {
public:
- explicit TestGroup(IStreamingReporterPtr&& reporter, Config const* config):
+ explicit TestGroup(IEventListenerPtr&& reporter, Config const* config):
m_reporter(reporter.get()),
m_config{config},
m_context{config, CATCH_MOVE(reporter)} {
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp
index 9c367fe9..7f6ed249 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp
@@ -251,7 +251,7 @@ namespace Catch {
virtual void listTags(std::vector<TagInfo> const& tags) = 0;
};
- using IStreamingReporterPtr = Detail::unique_ptr<IEventListener>;
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
} // end namespace Catch
diff --git a/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp b/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp
index 0f9b90cd..4300fdb2 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp
@@ -17,13 +17,13 @@ namespace Catch {
struct ReporterConfig;
struct IConfig;
class IEventListener;
- using IStreamingReporterPtr = Detail::unique_ptr<IEventListener>;
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
struct IReporterFactory {
virtual ~IReporterFactory(); // = default
- virtual IStreamingReporterPtr
+ virtual IEventListenerPtr
create( ReporterConfig const& config ) const = 0;
virtual std::string getDescription() const = 0;
};
@@ -32,7 +32,7 @@ namespace Catch {
class EventListenerFactory {
public:
virtual ~EventListenerFactory(); // = default
- virtual IStreamingReporterPtr create( IConfig const* config ) const = 0;
+ virtual IEventListenerPtr create( IConfig const* config ) const = 0;
virtual std::string getDescription() const = 0;
};
} // namespace Catch
diff --git a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
index 7a7b275d..fcb42755 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
@@ -20,7 +20,7 @@ namespace Catch {
struct IConfig;
class IEventListener;
- using IStreamingReporterPtr = Detail::unique_ptr<IEventListener>;
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
struct IReporterFactory;
using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
struct ReporterConfig;
@@ -31,7 +31,7 @@ namespace Catch {
using Listeners = std::vector<Detail::unique_ptr<EventListenerFactory>>;
virtual ~IReporterRegistry(); // = default
- virtual IStreamingReporterPtr create( std::string const& name, ReporterConfig const& config ) const = 0;
+ virtual IEventListenerPtr create( std::string const& name, ReporterConfig const& config ) const = 0;
virtual FactoryMap const& getFactories() const = 0;
virtual Listeners const& getListeners() const = 0;
};
diff --git a/src/catch2/internal/catch_reporter_registry.cpp b/src/catch2/internal/catch_reporter_registry.cpp
index 7ac3a606..56982e27 100644
--- a/src/catch2/internal/catch_reporter_registry.cpp
+++ b/src/catch2/internal/catch_reporter_registry.cpp
@@ -37,7 +37,7 @@ namespace Catch {
ReporterRegistry::~ReporterRegistry() = default;
- IStreamingReporterPtr ReporterRegistry::create( std::string const& name, ReporterConfig const& config ) const {
+ IEventListenerPtr ReporterRegistry::create( std::string const& name, ReporterConfig const& config ) const {
auto it = m_factories.find( name );
if( it == m_factories.end() )
return nullptr;
diff --git a/src/catch2/internal/catch_reporter_registry.hpp b/src/catch2/internal/catch_reporter_registry.hpp
index aaa99ba0..3466bfd8 100644
--- a/src/catch2/internal/catch_reporter_registry.hpp
+++ b/src/catch2/internal/catch_reporter_registry.hpp
@@ -21,7 +21,7 @@ namespace Catch {
ReporterRegistry();
~ReporterRegistry() override; // = default, out of line to allow fwd decl
- IStreamingReporterPtr create( std::string const& name, ReporterConfig const& config ) const override;
+ IEventListenerPtr create( std::string const& name, ReporterConfig const& config ) const override;
void registerReporter( std::string const& name, IReporterFactoryPtr factory );
void registerListener( Detail::unique_ptr<EventListenerFactory> factory );
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index 144bdb3c..6a32cdc1 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -160,7 +160,7 @@ namespace Catch {
GeneratorTracker::~GeneratorTracker() = default;
}
- RunContext::RunContext(IConfig const* _config, IStreamingReporterPtr&& reporter)
+ RunContext::RunContext(IConfig const* _config, IEventListenerPtr&& reporter)
: m_runInfo(_config->name()),
m_context(getCurrentMutableContext()),
m_config(_config),
diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp
index e0b64a04..4441a097 100644
--- a/src/catch2/internal/catch_run_context.hpp
+++ b/src/catch2/internal/catch_run_context.hpp
@@ -36,7 +36,7 @@ namespace Catch {
RunContext( RunContext const& ) = delete;
RunContext& operator =( RunContext const& ) = delete;
- explicit RunContext( IConfig const* _config, IStreamingReporterPtr&& reporter );
+ explicit RunContext( IConfig const* _config, IEventListenerPtr&& reporter );
~RunContext() override;
@@ -130,7 +130,7 @@ namespace Catch {
IConfig const* m_config;
Totals m_totals;
- IStreamingReporterPtr m_reporter;
+ IEventListenerPtr m_reporter;
std::vector<MessageInfo> m_messages;
std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */
AssertionInfo m_lastAssertionInfo;
diff --git a/src/catch2/reporters/catch_reporter_multi.cpp b/src/catch2/reporters/catch_reporter_multi.cpp
index 0e6b6040..86d39d6a 100644
--- a/src/catch2/reporters/catch_reporter_multi.cpp
+++ b/src/catch2/reporters/catch_reporter_multi.cpp
@@ -21,13 +21,13 @@ namespace Catch {
reporterish.getPreferences().shouldReportAllAssertions;
}
- void MultiReporter::addListener( IStreamingReporterPtr&& listener ) {
+ void MultiReporter::addListener( IEventListenerPtr&& listener ) {
updatePreferences(*listener);
m_reporterLikes.insert(m_reporterLikes.begin() + m_insertedListeners, CATCH_MOVE(listener) );
++m_insertedListeners;
}
- void MultiReporter::addReporter( IStreamingReporterPtr&& reporter ) {
+ void MultiReporter::addReporter( IEventListenerPtr&& reporter ) {
updatePreferences(*reporter);
// We will need to output the captured stdout if there are reporters
diff --git a/src/catch2/reporters/catch_reporter_multi.hpp b/src/catch2/reporters/catch_reporter_multi.hpp
index f6b51980..253063ae 100644
--- a/src/catch2/reporters/catch_reporter_multi.hpp
+++ b/src/catch2/reporters/catch_reporter_multi.hpp
@@ -19,7 +19,7 @@ namespace Catch {
* All Listeners are stored before all reporters, and individual
* listeners/reporters are stored in order of insertion.
*/
- std::vector<IStreamingReporterPtr> m_reporterLikes;
+ std::vector<IEventListenerPtr> m_reporterLikes;
bool m_haveNoncapturingReporters = false;
// Keep track of how many listeners we have already inserted,
@@ -33,8 +33,8 @@ namespace Catch {
IEventListener( config )
{}
- void addListener( IStreamingReporterPtr&& listener );
- void addReporter( IStreamingReporterPtr&& reporter );
+ void addListener( IEventListenerPtr&& listener );
+ void addReporter( IEventListenerPtr&& reporter );
public: // IEventListener
diff --git a/src/catch2/reporters/catch_reporter_registrars.hpp b/src/catch2/reporters/catch_reporter_registrars.hpp
index e607c368..d4bf8051 100644
--- a/src/catch2/reporters/catch_reporter_registrars.hpp
+++ b/src/catch2/reporters/catch_reporter_registrars.hpp
@@ -17,12 +17,12 @@
namespace Catch {
class IEventListener;
- using IStreamingReporterPtr = Detail::unique_ptr<IEventListener>;
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
template <typename T>
class ReporterFactory : public IReporterFactory {
- IStreamingReporterPtr create( ReporterConfig const& config ) const override {
+ IEventListenerPtr create( ReporterConfig const& config ) const override {
return Detail::make_unique<T>( config );
}
@@ -45,7 +45,7 @@ namespace Catch {
class TypedListenerFactory : public EventListenerFactory {
- IStreamingReporterPtr
+ IEventListenerPtr
create( IConfig const* config ) const override {
return Detail::make_unique<T>(config);
}
diff --git a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
index 890afe98..708f0903 100644
--- a/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/Reporters.tests.cpp
@@ -281,7 +281,7 @@ TEST_CASE("Multireporter updates ReporterPreferences properly",
namespace {
class TestReporterFactory : public Catch::IReporterFactory {
- Catch::IStreamingReporterPtr create( Catch::ReporterConfig const& ) const override {
+ Catch::IEventListenerPtr create( Catch::ReporterConfig const& ) const override {
CATCH_INTERNAL_ERROR(
"This factory should never create a reporter" );
}