Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Streamline includes in external interfaces

Commit
dd8e79c529f159415b5c567884e11d09bfd2ee0f
Author
Martin Hořeňovský ·
Parents
4453fefb00b6

Files · Download .tar.gz

Changes

 include/catch_session.hpp                    | 1 +
 include/internal/catch_config.cpp            | 1 +
 include/internal/catch_config.hpp            | 4 ++--
 include/internal/catch_context.h             | 4 ++--
 include/internal/catch_impl.hpp              | 2 --
 include/internal/catch_interfaces_reporter.h | 1 -
 include/internal/catch_list.cpp              | 1 +
 include/internal/catch_registry_hub.cpp      | 1 +
 include/internal/catch_run_context.cpp       | 1 +
 include/internal/catch_run_context.hpp       | 2 ++
 10 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/include/catch_session.hpp b/include/catch_session.hpp
index a423a3be..f02b93d9 100644
--- a/include/catch_session.hpp
+++ b/include/catch_session.hpp
@@ -13,6 +13,7 @@
 #include "internal/catch_enforce.h"
 #include "internal/catch_list.h"
 #include "internal/catch_run_context.hpp"
+#include "internal/catch_stream.h"
 #include "internal/catch_test_spec.hpp"
 #include "internal/catch_version.h"
 #include "internal/catch_interfaces_reporter.h"
diff --git a/include/internal/catch_config.cpp b/include/internal/catch_config.cpp
index d88a3d14..0f79a9ad 100644
--- a/include/internal/catch_config.cpp
+++ b/include/internal/catch_config.cpp
@@ -7,6 +7,7 @@
 
 #include "catch_config.hpp"
 #include "catch_enforce.h"
+#include "catch_stream.h"
 
 namespace Catch {
 
diff --git a/include/internal/catch_config.hpp b/include/internal/catch_config.hpp
index d2ca6202..0f86137f 100644
--- a/include/internal/catch_config.hpp
+++ b/include/internal/catch_config.hpp
@@ -9,9 +9,7 @@
 #define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
 
 #include "catch_test_spec_parser.hpp"
-#include "catch_context.h"
 #include "catch_interfaces_config.h"
-#include "catch_stream.h"
 
 #include <memory>
 #include <vector>
@@ -23,6 +21,8 @@
 
 namespace Catch {
 
+    struct IStream;
+
     struct ConfigData {
         bool listTests = false;
         bool listTags = false;
diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h
index 7815be22..39307f59 100644
--- a/include/internal/catch_context.h
+++ b/include/internal/catch_context.h
@@ -22,7 +22,7 @@ namespace Catch {
 
     struct IContext
     {
-        virtual ~IContext();
+        virtual ~IContext() = default;
 
         virtual IResultCapture* getResultCapture() = 0;
         virtual IRunner* getRunner() = 0;
@@ -31,7 +31,7 @@ namespace Catch {
 
     struct IMutableContext : IContext
     {
-        virtual ~IMutableContext();
+        virtual ~IMutableContext() = default;
         virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
         virtual void setRunner( IRunner* runner ) = 0;
         virtual void setConfig( IConfigPtr const& config ) = 0;
diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp
index 0d846e1d..785f3ddc 100644
--- a/include/internal/catch_impl.hpp
+++ b/include/internal/catch_impl.hpp
@@ -46,7 +46,6 @@ namespace Catch {
     CoutStream::~CoutStream() noexcept {}
     DebugOutStream::~DebugOutStream() noexcept {}
     StreamBufBase::~StreamBufBase() noexcept {}
-    IContext::~IContext() {}
     IResultCapture::~IResultCapture() {}
     ITestInvoker::~ITestInvoker() {}
     ITestCaseRegistry::~ITestCaseRegistry() {}
@@ -55,7 +54,6 @@ namespace Catch {
     IExceptionTranslator::~IExceptionTranslator() {}
     IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {}
     IRunner::~IRunner() {}
-    IMutableContext::~IMutableContext() {}
     IConfig::~IConfig() {}
 
     void Config::dummy() {}
diff --git a/include/internal/catch_interfaces_reporter.h b/include/internal/catch_interfaces_reporter.h
index def3684b..d1a5cb7c 100644
--- a/include/internal/catch_interfaces_reporter.h
+++ b/include/internal/catch_interfaces_reporter.h
@@ -11,7 +11,6 @@
 #include "catch_section_info.h"
 #include "catch_common.h"
 #include "catch_config.hpp"
-#include "catch_context.h"
 #include "catch_totals.hpp"
 #include "catch_test_case_info.h"
 #include "catch_assertionresult.h"
diff --git a/include/internal/catch_list.cpp b/include/internal/catch_list.cpp
index fa1b8793..8f2f291a 100644
--- a/include/internal/catch_list.cpp
+++ b/include/internal/catch_list.cpp
@@ -12,6 +12,7 @@
 #include "catch_interfaces_reporter.h"
 #include "catch_interfaces_testcase.h"
 
+#include "catch_stream.h"
 #include "catch_text.h"
 
 #include "catch_console_colour.hpp"
diff --git a/include/internal/catch_registry_hub.cpp b/include/internal/catch_registry_hub.cpp
index 454b5e06..7daa5572 100644
--- a/include/internal/catch_registry_hub.cpp
+++ b/include/internal/catch_registry_hub.cpp
@@ -8,6 +8,7 @@
 
 #include "catch_interfaces_registry_hub.h"
 
+#include "catch_context.h"
 #include "catch_test_case_registry_impl.hpp"
 #include "catch_reporter_registry.hpp"
 #include "catch_exception_translator_registry.h"
diff --git a/include/internal/catch_run_context.cpp b/include/internal/catch_run_context.cpp
index 24e3df1e..5d640e48 100644
--- a/include/internal/catch_run_context.cpp
+++ b/include/internal/catch_run_context.cpp
@@ -1,6 +1,7 @@
 #include "catch_run_context.hpp"
 #include "catch_context.h"
 #include "catch_enforce.h"
+#include "catch_stream.h"
 
 #include <cassert>
 #include <algorithm>
diff --git a/include/internal/catch_run_context.hpp b/include/internal/catch_run_context.hpp
index ca2316c1..40e77d29 100644
--- a/include/internal/catch_run_context.hpp
+++ b/include/internal/catch_run_context.hpp
@@ -26,6 +26,8 @@
 
 namespace Catch {
 
+    struct IMutableContext;
+
     class StreamRedirect {
 
     public: