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

Fix fallback stringifier config

Commit
bda4b7df844b7d6f68aa0faacfa17a348b02937f
Author
Martin Hořeňovský ·
Parents
0c722564c342

Files · Download .tar.gz

Changes

 src/catch2/catch_user_config.hpp.in | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/src/catch2/catch_user_config.hpp.in b/src/catch2/catch_user_config.hpp.in
index 3cfbed4a..b3a518f9 100644
--- a/src/catch2/catch_user_config.hpp.in
+++ b/src/catch2/catch_user_config.hpp.in
@@ -177,6 +177,7 @@
 #cmakedefine CATCH_CONFIG_PREFIX_ALL
 #cmakedefine CATCH_CONFIG_WINDOWS_CRTDBG
 
+
 // ------
 // "Variable" defines, these have actual values
 // ------
@@ -184,18 +185,10 @@
 #define CATCH_CONFIG_DEFAULT_REPORTER "@CATCH_CONFIG_DEFAULT_REPORTER@"
 #define CATCH_CONFIG_CONSOLE_WIDTH @CATCH_CONFIG_CONSOLE_WIDTH@
 
-// The logic here depends on CMake preprocessing of the file significantly.
-// If CMake has CATCH_CONFIG_FALLBACK_STRINGIFIER it will be define below,
-// and its value is written into the if. Thus, we undef the old placeholder
-// and then define the macro to the actual CMake-provided value.
-//
-// We can't do it without this indirection, because it is a string-variable
-// macro, so we need it's value, and there is no usable default value that
-// would let us have it always defined the way the other two are.
-#cmakedefine CATCH_CONFIG_FALLBACK_STRINGIFIER
-#if defined( CATCH_CONFIG_FALLBACK_STRINGIFIER )
-#    undef CATCH_CONFIG_FALLBACK_STRINGIFIER
-#    define CATCH_CONFIG_FALLBACK_STRINGIFIER @CATCH_CONFIG_FALLBACK_STRINGIFIER@
-#endif
+// Unlike the macros above, CATCH_CONFIG_FALLBACK_STRINGIFIER does not
+// have a good default value, so we cannot always define it, and cannot
+// even expose it as a variable in CMake. The users will have to find
+// out about it from docs and set it only if they use it.
+#cmakedefine CATCH_CONFIG_FALLBACK_STRINGIFIER @CATCH_CONFIG_FALLBACK_STRINGIFIER@
 
 #endif // CATCH_USER_CONFIG_HPP_INCLUDED