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

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-05-07 12:09:22 +0200
committerMartin Hořeňovský2023-05-07 20:58:54 +0200
commit0dc82e08dfec25faf6c6c145f3592984db7276cc (patch)
treead687a3fdb6968b5e5f654302bf1386692bb7fe6
parent8ca504cbc956d566ea77a8d59928146ad4cc3844 (diff)
downloadcatch3-0dc82e08dfec25faf6c6c145f3592984db7276cc.tar.gz
Move CATCH_INTERNAL_STRINGIFY macro into its own header
-rw-r--r--src/catch2/catch_all.hpp1
-rw-r--r--src/catch2/internal/catch_preprocessor_internal_stringify.hpp19
-rw-r--r--src/catch2/internal/catch_test_macro_impl.hpp7
-rw-r--r--src/catch2/matchers/internal/catch_matchers_impl.hpp7
-rw-r--r--src/catch2/meson.build1
5 files changed, 28 insertions, 7 deletions
diff --git a/src/catch2/catch_all.hpp b/src/catch2/catch_all.hpp
index 9b2cbe20..72de8de9 100644
--- a/src/catch2/catch_all.hpp
+++ b/src/catch2/catch_all.hpp
@@ -86,6 +86,7 @@
#include <catch2/internal/catch_platform.hpp>
#include <catch2/internal/catch_polyfills.hpp>
#include <catch2/internal/catch_preprocessor.hpp>
+#include <catch2/internal/catch_preprocessor_internal_stringify.hpp>
#include <catch2/internal/catch_preprocessor_remove_parens.hpp>
#include <catch2/internal/catch_random_number_generator.hpp>
#include <catch2/internal/catch_random_seed_generation.hpp>
diff --git a/src/catch2/internal/catch_preprocessor_internal_stringify.hpp b/src/catch2/internal/catch_preprocessor_internal_stringify.hpp
new file mode 100644
index 00000000..2fd64e1c
--- /dev/null
+++ b/src/catch2/internal/catch_preprocessor_internal_stringify.hpp
@@ -0,0 +1,19 @@
+
+// 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
+#ifndef CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED
+#define CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED
+
+#include <catch2/catch_user_config.hpp>
+
+#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
+ #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__##_catch_sr
+#else
+ #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"_catch_sr
+#endif
+
+#endif // CATCH_PREPROCESSOR_INTERNAL_STRINGIFY_HPP_INCLUDED
diff --git a/src/catch2/internal/catch_test_macro_impl.hpp b/src/catch2/internal/catch_test_macro_impl.hpp
index e569680b..8ed672ca 100644
--- a/src/catch2/internal/catch_test_macro_impl.hpp
+++ b/src/catch2/internal/catch_test_macro_impl.hpp
@@ -10,6 +10,7 @@
#include <catch2/catch_user_config.hpp>
#include <catch2/internal/catch_assertion_handler.hpp>
+#include <catch2/internal/catch_preprocessor_internal_stringify.hpp>
#include <catch2/interfaces/catch_interfaces_capture.hpp>
#include <catch2/internal/catch_stringref.hpp>
#include <catch2/internal/catch_source_line_info.hpp>
@@ -22,12 +23,6 @@
#if !defined(CATCH_CONFIG_DISABLE)
-#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
- #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__##_catch_sr
-#else
- #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"_catch_sr
-#endif
-
#if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/catch2/matchers/internal/catch_matchers_impl.hpp b/src/catch2/matchers/internal/catch_matchers_impl.hpp
index 12455bfe..2ee9f0c0 100644
--- a/src/catch2/matchers/internal/catch_matchers_impl.hpp
+++ b/src/catch2/matchers/internal/catch_matchers_impl.hpp
@@ -8,9 +8,14 @@
#ifndef CATCH_MATCHERS_IMPL_HPP_INCLUDED
#define CATCH_MATCHERS_IMPL_HPP_INCLUDED
-#include <catch2/internal/catch_test_macro_impl.hpp>
+#include <catch2/internal/catch_assertion_handler.hpp>
+#include <catch2/internal/catch_source_line_info.hpp>
+#include <catch2/internal/catch_decomposer.hpp>
+#include <catch2/internal/catch_preprocessor_internal_stringify.hpp>
#include <catch2/internal/catch_move_and_forward.hpp>
+#include <string>
+
namespace Catch {
template<typename ArgT, typename MatcherT>
diff --git a/src/catch2/meson.build b/src/catch2/meson.build
index 6aa1d9e1..89e96e23 100644
--- a/src/catch2/meson.build
+++ b/src/catch2/meson.build
@@ -110,6 +110,7 @@ internal_headers = [
'internal/catch_platform.hpp',
'internal/catch_polyfills.hpp',
'internal/catch_preprocessor.hpp',
+ 'internal/catch_preprocessor_internal_stringify.hpp',
'internal/catch_preprocessor_remove_parens.hpp',
'internal/catch_random_number_generator.hpp',
'internal/catch_random_seed_generation.hpp',