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

Prevent exception translator registration with CATCH_CONFIG_DISABLE

Commit
75f143835e1320f4bb5970e52505482ec9c7a1c9
Author
Martin Hořeňovský ·
Parents
05b6f03f3e8e

Files · Download .tar.gz

Changes

 include/catch.hpp                             | 2 +-
 include/internal/catch_interfaces_exception.h | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/include/catch.hpp b/include/catch.hpp
index 956c4b30..d49c7461 100644
--- a/include/catch.hpp
+++ b/include/catch.hpp
@@ -308,7 +308,7 @@ using Catch::Detail::Approx;
 
 #endif
 
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
+#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
 
 // "BDD-style" convenience wrappers
 #define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) )
diff --git a/include/internal/catch_interfaces_exception.h b/include/internal/catch_interfaces_exception.h
index 43e4fbf4..40b7e59b 100644
--- a/include/internal/catch_interfaces_exception.h
+++ b/include/internal/catch_interfaces_exception.h
@@ -8,11 +8,16 @@
 #ifndef TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
 #define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
 
+#include "catch_interfaces_registry_hub.h"
+
+#if defined(CATCH_CONFIG_DISABLE)
+    #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( translatorName, signature) \
+        static std::string translatorName( signature )
+#endif
+
 #include <string>
 #include <vector>
 
-#include "catch_interfaces_registry_hub.h"
-
 namespace Catch {
     using exceptionTranslateFunction = std::string(*)();