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

Add support for MINGW32 debugger

Commit
9e17c807bca49bef99dd23598b4a6cc413784a00
Author
Malcolm Noyes ·
Parents
aec1e5ed86bb

Files · Download .tar.gz

Changes

 include/internal/catch_debugger.hpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/internal/catch_debugger.hpp b/include/internal/catch_debugger.hpp
index 64383b46..25eeafe6 100644
--- a/include/internal/catch_debugger.hpp
+++ b/include/internal/catch_debugger.hpp
@@ -95,6 +95,14 @@
     {
         return IsDebuggerPresent() != 0;
     }
+#elif defined(__MINGW32__)
+    extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
+    extern "C" __declspec(dllimport) void __stdcall DebugBreak();
+    #define BreakIntoDebugger() if (IsDebuggerPresent() ) { DebugBreak(); }
+    inline bool isDebuggerActive()
+    {
+        return IsDebuggerPresent() != 0;
+    }
 #else
 	   inline void BreakIntoDebugger(){}
 	   inline bool isDebuggerActive() { return false; }