From 9b508e3ad2eaa3787471dd0a56a44662ccc0b7b8 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 29 Jan 2025 04:15:17 +0200 Subject: [PATCH] Disable <=> tests when isn't available --- test/array_thw_test.cpp | 11 +++++++++++ test/array_thw_test_cx.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/test/array_thw_test.cpp b/test/array_thw_test.cpp index 8f10368d..dca9d8c7 100644 --- a/test/array_thw_test.cpp +++ b/test/array_thw_test.cpp @@ -8,6 +8,12 @@ #include #include +#if defined(__has_include) +# if __has_include() +# define HAS_COMPARE +# endif +#endif + #if !defined(__cpp_impl_three_way_comparison) BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is not defined" ) @@ -18,6 +24,11 @@ int main() {} BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is defined to " BOOST_STRINGIZE(__cpp_impl_three_way_comparison) ) int main() {} +#elif !defined(HAS_COMPARE) + +BOOST_PRAGMA_MESSAGE( "Test skipped because is not available" ) +int main() {} + #else template void test() diff --git a/test/array_thw_test_cx.cpp b/test/array_thw_test_cx.cpp index 6b509385..dde5f654 100644 --- a/test/array_thw_test_cx.cpp +++ b/test/array_thw_test_cx.cpp @@ -8,6 +8,12 @@ #include #include +#if defined(__has_include) +# if __has_include() +# define HAS_COMPARE +# endif +#endif + #if !defined(__cpp_impl_three_way_comparison) BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is not defined" ) @@ -18,6 +24,11 @@ int main() {} BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is defined to " BOOST_STRINGIZE(__cpp_impl_three_way_comparison) ) int main() {} +#elif !defined(HAS_COMPARE) + +BOOST_PRAGMA_MESSAGE( "Test skipped because is not available" ) +int main() {} + #else #define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)