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

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-08-23 18:16:10 +0200
committerMartin Hořeňovský2020-08-23 21:01:04 +0200
commit9677df6d8b4a8b8e7a1b677068975af2caca5cc9 (patch)
tree920c0f847f720b3e55ba14cc4d9de12cfc4d13c7 /src
parented7eaf2df3dc4d38974234591d725c4cdba11a84 (diff)
downloadcatch3-9677df6d8b4a8b8e7a1b677068975af2caca5cc9.tar.gz
Split IReporterRegistry into its own header file
Doing this removes `<map>` from the include set of the base reporter interface, and thus from bunch more TUs. This provides about 1.5% improvements in the debug build of the static library, and 1% in release build.
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/catch2/catch_session.cpp1
-rw-r--r--src/catch2/interfaces/catch_interfaces_all.hpp1
-rw-r--r--src/catch2/interfaces/catch_interfaces_combined_tu.cpp6
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.cpp1
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter.hpp12
-rw-r--r--src/catch2/interfaces/catch_interfaces_reporter_registry.hpp31
-rw-r--r--src/catch2/internal/catch_commandline.cpp1
-rw-r--r--src/catch2/internal/catch_list.cpp1
-rw-r--r--src/catch2/internal/catch_reporter_registry.hpp1
10 files changed, 43 insertions, 13 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0bc0fc3d..e772ebd1 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_registry.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_runner.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_tag_alias_registry.hpp
${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp
diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp
index 809f4f89..114875f9 100644
--- a/src/catch2/catch_session.cpp
+++ b/src/catch2/catch_session.cpp
@@ -19,6 +19,7 @@
#include <catch2/internal/catch_textflow.hpp>
#include <catch2/internal/catch_windows_h_proxy.hpp>
#include <catch2/reporters/catch_reporter_listening.hpp>
+#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
#include <algorithm>
#include <iomanip>
diff --git a/src/catch2/interfaces/catch_interfaces_all.hpp b/src/catch2/interfaces/catch_interfaces_all.hpp
index c70ed3ed..d6a3ef72 100644
--- a/src/catch2/interfaces/catch_interfaces_all.hpp
+++ b/src/catch2/interfaces/catch_interfaces_all.hpp
@@ -22,6 +22,7 @@
#include <catch2/interfaces/catch_interfaces_generatortracker.hpp>
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
+#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
#include <catch2/interfaces/catch_interfaces_runner.hpp>
#include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp>
#include <catch2/interfaces/catch_interfaces_testcase.hpp>
diff --git a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp b/src/catch2/interfaces/catch_interfaces_combined_tu.cpp
index e35b865e..c196e872 100644
--- a/src/catch2/interfaces/catch_interfaces_combined_tu.cpp
+++ b/src/catch2/interfaces/catch_interfaces_combined_tu.cpp
@@ -77,3 +77,9 @@ namespace Catch {
ITestInvoker::~ITestInvoker() = default;
ITestCaseRegistry::~ITestCaseRegistry() = default;
}
+
+
+#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
+namespace Catch {
+ IReporterRegistry::~IReporterRegistry() = default;
+}
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.cpp b/src/catch2/interfaces/catch_interfaces_reporter.cpp
index 93a1baad..01ac1705 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.cpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.cpp
@@ -187,6 +187,5 @@ namespace Catch {
}
IReporterFactory::~IReporterFactory() = default;
- IReporterRegistry::~IReporterRegistry() = default;
} // end namespace Catch
diff --git a/src/catch2/interfaces/catch_interfaces_reporter.hpp b/src/catch2/interfaces/catch_interfaces_reporter.hpp
index ba3d1ecd..af08c503 100644
--- a/src/catch2/interfaces/catch_interfaces_reporter.hpp
+++ b/src/catch2/interfaces/catch_interfaces_reporter.hpp
@@ -24,7 +24,6 @@
#include <string>
#include <vector>
#include <iosfwd>
-#include <map>
namespace Catch {
@@ -33,7 +32,6 @@ namespace Catch {
struct TestCaseInfo;
class TestCaseHandle;
struct IConfig;
- class Config;
struct ReporterConfig {
explicit ReporterConfig( IConfig const* _fullConfig );
@@ -251,16 +249,6 @@ namespace Catch {
};
using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
- struct IReporterRegistry {
- using FactoryMap = std::map<std::string, IReporterFactoryPtr>;
- using Listeners = std::vector<IReporterFactoryPtr>;
-
- virtual ~IReporterRegistry();
- virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0;
- virtual FactoryMap const& getFactories() const = 0;
- virtual Listeners const& getListeners() const = 0;
- };
-
} // end namespace Catch
#endif // TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED
diff --git a/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
new file mode 100644
index 00000000..da4ab757
--- /dev/null
+++ b/src/catch2/interfaces/catch_interfaces_reporter_registry.hpp
@@ -0,0 +1,31 @@
+#ifndef CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
+#define CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
+
+#include <catch2/internal/catch_unique_ptr.hpp>
+
+#include <string>
+#include <vector>
+#include <map>
+
+namespace Catch {
+
+ struct IConfig;
+
+ struct IStreamingReporter;
+ using IStreamingReporterPtr = Detail::unique_ptr<IStreamingReporter>;
+ struct IReporterFactory;
+ using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
+
+ struct IReporterRegistry {
+ using FactoryMap = std::map<std::string, IReporterFactoryPtr>;
+ using Listeners = std::vector<IReporterFactoryPtr>;
+
+ virtual ~IReporterRegistry();
+ virtual IStreamingReporterPtr create( std::string const& name, IConfig const* config ) const = 0;
+ virtual FactoryMap const& getFactories() const = 0;
+ virtual Listeners const& getListeners() const = 0;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
diff --git a/src/catch2/internal/catch_commandline.cpp b/src/catch2/internal/catch_commandline.cpp
index c6b46721..4d08bf5c 100644
--- a/src/catch2/internal/catch_commandline.cpp
+++ b/src/catch2/internal/catch_commandline.cpp
@@ -11,6 +11,7 @@
#include <catch2/catch_config.hpp>
#include <catch2/internal/catch_string_manip.hpp>
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
+#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
#include <fstream>
diff --git a/src/catch2/internal/catch_list.cpp b/src/catch2/internal/catch_list.cpp
index 478ace0c..2bb777a3 100644
--- a/src/catch2/internal/catch_list.cpp
+++ b/src/catch2/internal/catch_list.cpp
@@ -10,6 +10,7 @@
#include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
+#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
#include <catch2/interfaces/catch_interfaces_testcase.hpp>
#include <catch2/internal/catch_context.hpp>
diff --git a/src/catch2/internal/catch_reporter_registry.hpp b/src/catch2/internal/catch_reporter_registry.hpp
index ab073959..7a490a47 100644
--- a/src/catch2/internal/catch_reporter_registry.hpp
+++ b/src/catch2/internal/catch_reporter_registry.hpp
@@ -9,6 +9,7 @@
#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_H_INCLUDED
#include <catch2/interfaces/catch_interfaces_reporter.hpp>
+#include <catch2/interfaces/catch_interfaces_reporter_registry.hpp>
#include <map>