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

summaryrefslogtreecommitdiffhomepage
path: root/projects/ExtraTests/X12-CustomDebugBreakMacro.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-02-01 20:17:54 +0100
committerMartin Hořeňovský2020-02-16 15:47:00 +0100
commit89f18f15cae32f201ddad2cb110f062659e1bc3c (patch)
treef0934a3cf9d2111ee0b99117ffc37d2e8c95d18d /projects/ExtraTests/X12-CustomDebugBreakMacro.cpp
parent3c7e737a7bcf2d2059b1db2a5a221f76806ae8b0 (diff)
downloadcatch3-89f18f15cae32f201ddad2cb110f062659e1bc3c.tar.gz
Add a test for custom debug break macros
See #1846
Diffstat (limited to 'projects/ExtraTests/X12-CustomDebugBreakMacro.cpp')
-rw-r--r--projects/ExtraTests/X12-CustomDebugBreakMacro.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/projects/ExtraTests/X12-CustomDebugBreakMacro.cpp b/projects/ExtraTests/X12-CustomDebugBreakMacro.cpp
new file mode 100644
index 00000000..25ab4a0e
--- /dev/null
+++ b/projects/ExtraTests/X12-CustomDebugBreakMacro.cpp
@@ -0,0 +1,17 @@
+// X12-CustomDebugBreakMacro.cpp
+// Test that user-defined `CATCH_BREAK_INTO_DEBUGGER` is respected and used.
+
+#include <iostream>
+
+void custom_debug_break() {
+ std::cerr << "Pretty please, break into debugger\n";
+}
+
+#define CATCH_BREAK_INTO_DEBUGGER() custom_debug_break()
+
+#define CATCH_CONFIG_MAIN
+#include <catch2/catch.hpp>
+
+TEST_CASE("Failing test that breaks into debugger", "[macros]") {
+ REQUIRE(1 == 2);
+}