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

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_test_failure_exception.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2022-11-05 00:22:45 +0100
committerMartin Hořeňovský2022-11-05 00:22:45 +0100
commit5f9d4ef3319f2b13011161662ca2b02d0feb4667 (patch)
tree8d64bc6b62fb4ec1c12078cc8cef53aa9fb55a5c /src/catch2/internal/catch_test_failure_exception.cpp
parentec59cd8736b7ee8fcd69c76c71c2a0b72293b00c (diff)
downloadcatch3-5f9d4ef3319f2b13011161662ca2b02d0feb4667.tar.gz
Move throwing test failure exceptions into a helper
Diffstat (limited to 'src/catch2/internal/catch_test_failure_exception.cpp')
-rw-r--r--src/catch2/internal/catch_test_failure_exception.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/catch2/internal/catch_test_failure_exception.cpp b/src/catch2/internal/catch_test_failure_exception.cpp
new file mode 100644
index 00000000..c1edff3c
--- /dev/null
+++ b/src/catch2/internal/catch_test_failure_exception.cpp
@@ -0,0 +1,23 @@
+
+// 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
+
+#include <catch2/internal/catch_test_failure_exception.hpp>
+#include <catch2/internal/catch_enforce.hpp>
+#include <catch2/catch_user_config.hpp>
+
+namespace Catch {
+
+ void throw_test_failure_exception() {
+#if !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS )
+ throw TestFailureException{};
+#else
+ CATCH_ERROR( "Test failure requires aborting test!" );
+#endif
+ }
+
+} // namespace Catch