From 6a08d401aabac2ead19c3eff17647a2b482f96b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sun, 23 Aug 2020 21:19:26 +0200 Subject: [PATCH] Split out ReporterFactory out of catch_interfaces_reporter.hpp --- src/CMakeLists.txt | 1 + src/catch2/catch_registry_hub.cpp | 1 + src/catch2/catch_reporter_registrars.hpp | 1 + src/catch2/catch_session.cpp | 1 + src/catch2/interfaces/catch_interfaces_all.hpp | 1 + .../catch_interfaces_combined_tu.cpp | 7 +++++++ .../interfaces/catch_interfaces_reporter.cpp | 2 -- .../interfaces/catch_interfaces_reporter.hpp | 7 ------- .../catch_interfaces_reporter_factory.hpp | 18 ++++++++++++++++++ src/catch2/internal/catch_list.cpp | 1 + 10 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 src/catch2/interfaces/catch_interfaces_reporter_factory.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e772ebd1..730b5c52 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,6 +72,7 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/interfaces/catch_interfaces_generatortracker.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_registry_hub.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp + ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_registry.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_runner.hpp ${SOURCES_DIR}/interfaces/catch_interfaces_tag_alias_registry.hpp diff --git a/src/catch2/catch_registry_hub.cpp b/src/catch2/catch_registry_hub.cpp index c25b1cec..54e72904 100644 --- a/src/catch2/catch_registry_hub.cpp +++ b/src/catch2/catch_registry_hub.cpp @@ -19,6 +19,7 @@ #include #include #include +#include namespace Catch { diff --git a/src/catch2/catch_reporter_registrars.hpp b/src/catch2/catch_reporter_registrars.hpp index 8ad600ea..d892892c 100644 --- a/src/catch2/catch_reporter_registrars.hpp +++ b/src/catch2/catch_reporter_registrars.hpp @@ -10,6 +10,7 @@ #define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED #include +#include #include namespace Catch { diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp index 114875f9..ed111715 100644 --- a/src/catch2/catch_session.cpp +++ b/src/catch2/catch_session.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/src/catch2/interfaces/catch_interfaces_all.hpp b/src/catch2/interfaces/catch_interfaces_all.hpp index d6a3ef72..1f7facbe 100644 --- a/src/catch2/interfaces/catch_interfaces_all.hpp +++ b/src/catch2/interfaces/catch_interfaces_all.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include diff --git a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp b/src/catch2/interfaces/catch_interfaces_combined_tu.cpp index c196e872..8790f4dc 100644 --- a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp +++ b/src/catch2/interfaces/catch_interfaces_combined_tu.cpp @@ -83,3 +83,10 @@ namespace Catch { namespace Catch { IReporterRegistry::~IReporterRegistry() = default; } + + +#include + +namespace Catch { + IReporterFactory::~IReporterFactory() = default; +} diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp index 01ac1705..9f779c7b 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.cpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp @@ -186,6 +186,4 @@ namespace Catch { Catch::cout() << pluralise(tags.size(), "tag") << '\n' << std::endl; } - IReporterFactory::~IReporterFactory() = default; - } // end namespace Catch diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp index af08c503..d7a5b087 100644 --- a/src/catch2/interfaces/catch_interfaces_reporter.hpp +++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp @@ -242,13 +242,6 @@ namespace Catch { }; using IStreamingReporterPtr = Detail::unique_ptr; - struct IReporterFactory { - virtual ~IReporterFactory(); - virtual IStreamingReporterPtr create( ReporterConfig const& config ) const = 0; - virtual std::string getDescription() const = 0; - }; - using IReporterFactoryPtr = Detail::unique_ptr; - } // end namespace Catch #endif // TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED diff --git a/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp b/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp new file mode 100644 index 00000000..a54a518d --- /dev/null +++ b/src/catch2/interfaces/catch_interfaces_reporter_factory.hpp @@ -0,0 +1,18 @@ +#ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED +#define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED + +namespace Catch { + + struct ReporterConfig; + + struct IReporterFactory { + virtual ~IReporterFactory(); // = default + + virtual IStreamingReporterPtr + create( ReporterConfig const& config ) const = 0; + virtual std::string getDescription() const = 0; + }; + using IReporterFactoryPtr = Detail::unique_ptr; +} // namespace Catch + +#endif // CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED diff --git a/src/catch2/internal/catch_list.cpp b/src/catch2/internal/catch_list.cpp index 2bb777a3..3f142aba 100644 --- a/src/catch2/internal/catch_list.cpp +++ b/src/catch2/internal/catch_list.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include