Skip to content

Commit 9b508e3

Browse files
committed
Disable <=> tests when <compare> isn't available
1 parent 84d0f84 commit 9b508e3

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

test/array_thw_test.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
#include <boost/config/pragma_message.hpp>
99
#include <cstddef>
1010

11+
#if defined(__has_include)
12+
# if __has_include(<compare>)
13+
# define HAS_COMPARE
14+
# endif
15+
#endif
16+
1117
#if !defined(__cpp_impl_three_way_comparison)
1218

1319
BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is not defined" )
@@ -18,6 +24,11 @@ int main() {}
1824
BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is defined to " BOOST_STRINGIZE(__cpp_impl_three_way_comparison) )
1925
int main() {}
2026

27+
#elif !defined(HAS_COMPARE)
28+
29+
BOOST_PRAGMA_MESSAGE( "Test skipped because <compare> is not available" )
30+
int main() {}
31+
2132
#else
2233

2334
template<class T, std::size_t N> void test()

test/array_thw_test_cx.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
#include <boost/config/workaround.hpp>
99
#include <cstddef>
1010

11+
#if defined(__has_include)
12+
# if __has_include(<compare>)
13+
# define HAS_COMPARE
14+
# endif
15+
#endif
16+
1117
#if !defined(__cpp_impl_three_way_comparison)
1218

1319
BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is not defined" )
@@ -18,6 +24,11 @@ int main() {}
1824
BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is defined to " BOOST_STRINGIZE(__cpp_impl_three_way_comparison) )
1925
int main() {}
2026

27+
#elif !defined(HAS_COMPARE)
28+
29+
BOOST_PRAGMA_MESSAGE( "Test skipped because <compare> is not available" )
30+
int main() {}
31+
2132
#else
2233

2334
#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)

0 commit comments

Comments
 (0)