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

Split ITestInvoker into its own header

Commit
1f881ab4641b866304b818a063164dae976dba5f
Author
Martin Hořeňovský ·
Parents
c487b27d9d98

Files · Download .tar.gz

Changes

 src/CMakeLists.txt                                  |  1 +
 src/catch2/catch_session.cpp                        |  1 +
 src/catch2/catch_test_spec.cpp                      |  1 +
 src/catch2/interfaces/catch_interfaces_all.hpp      |  1 +
 .../interfaces/catch_interfaces_test_invoker.hpp    | 21 +++++++++++++++++++++
 src/catch2/interfaces/catch_interfaces_testcase.cpp |  1 -
 src/catch2/interfaces/catch_interfaces_testcase.hpp |  7 -------
 .../internal/catch_test_case_registry_impl.hpp      |  3 ++-
 src/catch2/internal/catch_test_registry.cpp         |  1 +
 src/catch2/internal/catch_test_registry.hpp         |  2 +-
 src/catch2/meson.build                              |  1 +
 11 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 47b7dfe5..e70ae580 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -218,6 +218,7 @@ set(INTERFACE_HEADERS
   ${SOURCES_DIR}/interfaces/catch_interfaces_reporter.hpp
   ${SOURCES_DIR}/interfaces/catch_interfaces_reporter_factory.hpp
   ${SOURCES_DIR}/interfaces/catch_interfaces_tag_alias_registry.hpp
+  ${SOURCES_DIR}/interfaces/catch_interfaces_test_invoker.hpp
   ${SOURCES_DIR}/interfaces/catch_interfaces_testcase.hpp
 )
 set(INTERFACE_SOURCES
diff --git a/src/catch2/catch_session.cpp b/src/catch2/catch_session.cpp
index a73334f4..259026d0 100644
--- a/src/catch2/catch_session.cpp
+++ b/src/catch2/catch_session.cpp
@@ -13,6 +13,7 @@
 #include <catch2/internal/catch_run_context.hpp>
 #include <catch2/catch_test_spec.hpp>
 #include <catch2/catch_version.hpp>
+#include <catch2/interfaces/catch_interfaces_testcase.hpp>
 #include <catch2/interfaces/catch_interfaces_reporter.hpp>
 #include <catch2/internal/catch_startup_exception_registry.hpp>
 #include <catch2/internal/catch_sharding.hpp>
diff --git a/src/catch2/catch_test_spec.cpp b/src/catch2/catch_test_spec.cpp
index f27ce99c..2a7fd563 100644
--- a/src/catch2/catch_test_spec.cpp
+++ b/src/catch2/catch_test_spec.cpp
@@ -6,6 +6,7 @@
 
 // SPDX-License-Identifier: BSL-1.0
 #include <catch2/catch_test_spec.hpp>
+#include <catch2/interfaces/catch_interfaces_testcase.hpp>
 #include <catch2/internal/catch_reusable_string_stream.hpp>
 #include <catch2/internal/catch_string_manip.hpp>
 #include <catch2/catch_test_case_info.hpp>
diff --git a/src/catch2/interfaces/catch_interfaces_all.hpp b/src/catch2/interfaces/catch_interfaces_all.hpp
index 7a0d0c29..a99fdcdc 100644
--- a/src/catch2/interfaces/catch_interfaces_all.hpp
+++ b/src/catch2/interfaces/catch_interfaces_all.hpp
@@ -31,6 +31,7 @@
 #include <catch2/interfaces/catch_interfaces_reporter.hpp>
 #include <catch2/interfaces/catch_interfaces_reporter_factory.hpp>
 #include <catch2/interfaces/catch_interfaces_tag_alias_registry.hpp>
+#include <catch2/interfaces/catch_interfaces_test_invoker.hpp>
 #include <catch2/interfaces/catch_interfaces_testcase.hpp>
 
 #endif // CATCH_INTERFACES_ALL_HPP_INCLUDED
diff --git a/src/catch2/interfaces/catch_interfaces_test_invoker.hpp b/src/catch2/interfaces/catch_interfaces_test_invoker.hpp
new file mode 100644
index 00000000..3caeff9a
--- /dev/null
+++ b/src/catch2/interfaces/catch_interfaces_test_invoker.hpp
@@ -0,0 +1,21 @@
+
+//              Copyright Catch2 Authors
+// Distributed under the Boost Software License, Version 1.0.
+//   (See accompanying file LICENSE.txt or copy at
+//        https://www.boost.org/LICENSE_1_0.txt)
+
+// SPDX-License-Identifier: BSL-1.0
+#ifndef CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED
+#define CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED
+
+namespace Catch {
+
+    class ITestInvoker {
+    public:
+        virtual void invoke() const = 0;
+        virtual ~ITestInvoker(); // = default
+    };
+
+} // namespace Catch
+
+#endif // CATCH_INTERFACES_TEST_INVOKER_HPP_INCLUDED
diff --git a/src/catch2/interfaces/catch_interfaces_testcase.cpp b/src/catch2/interfaces/catch_interfaces_testcase.cpp
index 5e632ba8..a543116c 100644
--- a/src/catch2/interfaces/catch_interfaces_testcase.cpp
+++ b/src/catch2/interfaces/catch_interfaces_testcase.cpp
@@ -9,6 +9,5 @@
 #include <catch2/interfaces/catch_interfaces_testcase.hpp>
 
 namespace Catch {
-    ITestInvoker::~ITestInvoker() = default;
     ITestCaseRegistry::~ITestCaseRegistry() = default;
 }
diff --git a/src/catch2/interfaces/catch_interfaces_testcase.hpp b/src/catch2/interfaces/catch_interfaces_testcase.hpp
index 78ee2021..f8e20351 100644
--- a/src/catch2/interfaces/catch_interfaces_testcase.hpp
+++ b/src/catch2/interfaces/catch_interfaces_testcase.hpp
@@ -14,13 +14,6 @@ namespace Catch {
 
     class TestSpec;
     struct TestCaseInfo;
-
-    class ITestInvoker {
-    public:
-        virtual void invoke () const = 0;
-        virtual ~ITestInvoker(); // = default
-    };
-
     class TestCaseHandle;
     class IConfig;
 
diff --git a/src/catch2/internal/catch_test_case_registry_impl.hpp b/src/catch2/internal/catch_test_case_registry_impl.hpp
index cc6b133f..6784e034 100644
--- a/src/catch2/internal/catch_test_case_registry_impl.hpp
+++ b/src/catch2/internal/catch_test_case_registry_impl.hpp
@@ -16,8 +16,9 @@
 
 namespace Catch {
 
-    class TestCaseHandle;
     class IConfig;
+    class ITestInvoker;
+    class TestCaseHandle;
     class TestSpec;
 
     std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases );
diff --git a/src/catch2/internal/catch_test_registry.cpp b/src/catch2/internal/catch_test_registry.cpp
index b798fb60..e9c999fe 100644
--- a/src/catch2/internal/catch_test_registry.cpp
+++ b/src/catch2/internal/catch_test_registry.cpp
@@ -16,6 +16,7 @@
 #include <iterator>
 
 namespace Catch {
+    ITestInvoker::~ITestInvoker() = default;
 
     namespace {
         static StringRef extractClassName( StringRef classOrMethodName ) {
diff --git a/src/catch2/internal/catch_test_registry.hpp b/src/catch2/internal/catch_test_registry.hpp
index f53b93c8..5cb73067 100644
--- a/src/catch2/internal/catch_test_registry.hpp
+++ b/src/catch2/internal/catch_test_registry.hpp
@@ -10,7 +10,7 @@
 
 #include <catch2/internal/catch_source_line_info.hpp>
 #include <catch2/internal/catch_noncopyable.hpp>
-#include <catch2/interfaces/catch_interfaces_testcase.hpp>
+#include <catch2/interfaces/catch_interfaces_test_invoker.hpp>
 #include <catch2/internal/catch_stringref.hpp>
 #include <catch2/internal/catch_unique_ptr.hpp>
 #include <catch2/internal/catch_unique_name.hpp>
diff --git a/src/catch2/meson.build b/src/catch2/meson.build
index b5ffc224..789d847d 100644
--- a/src/catch2/meson.build
+++ b/src/catch2/meson.build
@@ -65,6 +65,7 @@ internal_headers = [
   'interfaces/catch_interfaces_reporter.hpp',
   'interfaces/catch_interfaces_reporter_factory.hpp',
   'interfaces/catch_interfaces_tag_alias_registry.hpp',
+  'interfaces/catch_interfaces_test_invoker.hpp',
   'interfaces/catch_interfaces_testcase.hpp',
   'internal/catch_assertion_handler.hpp',
   'internal/catch_case_insensitive_comparisons.hpp',