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 TestFailureException into its own header

Commit
e7740316e37072131a4d6d9eeb56eabfd867dbf2
Author
Martin Hořeňovský ·
Parents
72525a3053f6

Files · Download .tar.gz

Changes

 src/CMakeLists.txt                                     |  1 +
 src/catch2/catch_all.hpp                               |  1 +
 src/catch2/internal/catch_assertion_handler.cpp        |  1 +
 src/catch2/internal/catch_assertion_handler.hpp        |  1 -
 .../internal/catch_exception_translator_registry.cpp   |  2 +-
 src/catch2/internal/catch_run_context.cpp              |  1 +
 src/catch2/internal/catch_test_failure_exception.hpp   | 18 ++++++++++++++++++
 7 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6398b808..ea6f7f75 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -44,6 +44,7 @@ set(INTERNAL_HEADERS
     ${SOURCES_DIR}/catch_assertion_info.hpp
     ${SOURCES_DIR}/catch_assertion_result.hpp
     ${SOURCES_DIR}/internal/catch_test_macro_impl.hpp
+    ${SOURCES_DIR}/internal/catch_test_failure_exception.hpp
     ${SOURCES_DIR}/internal/catch_case_sensitive.hpp
     ${SOURCES_DIR}/internal/catch_clara.hpp
     ${SOURCES_DIR}/internal/catch_commandline.hpp
diff --git a/src/catch2/catch_all.hpp b/src/catch2/catch_all.hpp
index e266a26f..f6acd83b 100644
--- a/src/catch2/catch_all.hpp
+++ b/src/catch2/catch_all.hpp
@@ -90,6 +90,7 @@
 #include <catch2/internal/catch_template_test_registry.hpp>
 #include <catch2/internal/catch_test_case_registry_impl.hpp>
 #include <catch2/internal/catch_test_case_tracker.hpp>
+#include <catch2/internal/catch_test_failure_exception.hpp>
 #include <catch2/internal/catch_test_macro_impl.hpp>
 #include <catch2/internal/catch_test_registry.hpp>
 #include <catch2/internal/catch_test_spec_parser.hpp>
diff --git a/src/catch2/internal/catch_assertion_handler.cpp b/src/catch2/internal/catch_assertion_handler.cpp
index 3ed5dcf6..7774ca68 100644
--- a/src/catch2/internal/catch_assertion_handler.cpp
+++ b/src/catch2/internal/catch_assertion_handler.cpp
@@ -10,6 +10,7 @@
 #include <catch2/internal/catch_context.hpp>
 #include <catch2/internal/catch_enforce.hpp>
 #include <catch2/internal/catch_debugger.hpp>
+#include <catch2/internal/catch_test_failure_exception.hpp>
 #include <catch2/interfaces/catch_interfaces_registry_hub.hpp>
 #include <catch2/internal/catch_run_context.hpp>
 #include <catch2/matchers/catch_matchers_string.hpp>
diff --git a/src/catch2/internal/catch_assertion_handler.hpp b/src/catch2/internal/catch_assertion_handler.hpp
index e332439e..8e266ade 100644
--- a/src/catch2/internal/catch_assertion_handler.hpp
+++ b/src/catch2/internal/catch_assertion_handler.hpp
@@ -15,7 +15,6 @@
 
 namespace Catch {
 
-    struct TestFailureException{};
     struct AssertionResultData;
     struct IResultCapture;
     class RunContext;
diff --git a/src/catch2/internal/catch_exception_translator_registry.cpp b/src/catch2/internal/catch_exception_translator_registry.cpp
index 1894dac4..08483889 100644
--- a/src/catch2/internal/catch_exception_translator_registry.cpp
+++ b/src/catch2/internal/catch_exception_translator_registry.cpp
@@ -6,9 +6,9 @@
 
 // SPDX-License-Identifier: BSL-1.0
 #include <catch2/internal/catch_exception_translator_registry.hpp>
-#include <catch2/internal/catch_assertion_handler.hpp>
 #include <catch2/internal/catch_compiler_capabilities.hpp>
 #include <catch2/internal/catch_enforce.hpp>
+#include <catch2/internal/catch_test_failure_exception.hpp>
 
 namespace Catch {
 
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp
index f755a57e..777c7075 100644
--- a/src/catch2/internal/catch_run_context.cpp
+++ b/src/catch2/internal/catch_run_context.cpp
@@ -17,6 +17,7 @@
 #include <catch2/catch_timer.hpp>
 #include <catch2/internal/catch_output_redirect.hpp>
 #include <catch2/internal/catch_assertion_handler.hpp>
+#include <catch2/internal/catch_test_failure_exception.hpp>
 
 #include <cassert>
 #include <algorithm>
diff --git a/src/catch2/internal/catch_test_failure_exception.hpp b/src/catch2/internal/catch_test_failure_exception.hpp
new file mode 100644
index 00000000..bb6803ba
--- /dev/null
+++ b/src/catch2/internal/catch_test_failure_exception.hpp
@@ -0,0 +1,18 @@
+
+//              Copyright Catch2 Authors
+// Distributed under the Boost Software License, Version 1.0.
+//   (See accompanying file LICENSE_1_0.txt or copy at
+//        https://www.boost.org/LICENSE_1_0.txt)
+
+// SPDX-License-Identifier: BSL-1.0
+#ifndef CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED
+#define CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED
+
+namespace Catch {
+
+    //! Used to signal that an assertion macro failed
+    struct TestFailureException{};
+
+} // namespace Catch
+
+#endif // CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED