From e7740316e37072131a4d6d9eeb56eabfd867dbf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Fri, 27 Nov 2020 18:08:37 +0100 Subject: [PATCH] Split TestFailureException into its own header --- src/CMakeLists.txt | 1 + src/catch2/catch_all.hpp | 1 + .../internal/catch_assertion_handler.cpp | 1 + .../internal/catch_assertion_handler.hpp | 1 - .../catch_exception_translator_registry.cpp | 2 +- src/catch2/internal/catch_run_context.cpp | 1 + .../internal/catch_test_failure_exception.hpp | 18 ++++++++++++++++++ 7 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/catch2/internal/catch_test_failure_exception.hpp 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 #include #include +#include #include #include #include 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 #include #include +#include #include #include #include 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 -#include #include #include +#include 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 #include #include +#include #include #include 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