From 92e55e842e6e3f8a760e1d72b2a8702fa852b378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Ferdinand=20Rivera=20Morell?= Date: Fri, 12 Apr 2024 11:12:54 -0500 Subject: [PATCH] Add macOS testing. (#75) Fixes https://github.com/boostorg/lexical_cast/issues/76 --------- Co-authored-by: Antony Polukhin --- .github/workflows/ci.yml | 3 +++ test/Jamfile.v2 | 3 ++- test/integral_types_test.cpp | 3 ++- test/lexical_cast_test.cpp | 14 ++++++-------- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04c9166..185dcea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,9 @@ jobs: compiler: clang++-14 cxxstd: "03,11,14,17,2a" os: ubuntu-22.04 + - toolset: clang + cxxstd: "11,14,17,20" + os: macos-13 runs-on: ${{matrix.os}} diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 08a67b5..e68e037 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -48,7 +48,8 @@ test-suite conversion # Make sure that LexicalCast works the same way as some of the C++ Standard Libraries [ run float_types_test.cpp : : : BOOST_LEXICAL_CAST_DETAIL_TEST_ON_OLD - msvc:no # could have outdated behavior in some border cases + msvc:no # could have outdated behavior in some border cases + darwin:no # may have outdated behavior in some border cases : float_types_non_opt ] diff --git a/test/integral_types_test.cpp b/test/integral_types_test.cpp index 8ecb037..972ebed 100644 --- a/test/integral_types_test.cpp +++ b/test/integral_types_test.cpp @@ -40,7 +40,8 @@ #define BOOST_LCAST_NO_WCHAR_T #endif -#if defined(BOOST_HAS_INT128) && !defined(BOOST_LEXICAL_CAST_TEST_NO_128_INTS) +// There's no typeinfo for unsigned __int128 in Xcode_15.0.1 +#if defined(BOOST_HAS_INT128) && !defined(BOOST_LEXICAL_CAST_TEST_NO_128_INTS) && !defined(__APPLE__) # define BOOST_LCAST_TEST_128 1 #endif diff --git a/test/lexical_cast_test.cpp b/test/lexical_cast_test.cpp index ee3ecb8..289f6a8 100644 --- a/test/lexical_cast_test.cpp +++ b/test/lexical_cast_test.cpp @@ -523,21 +523,23 @@ void operators_overload_test() } -#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) void test_char16_conversions() { +// There's no std::ctype in Xcode_15.0.1 +#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(__APPLE__) BOOST_TEST(u"100" == lexical_cast(u"100")); BOOST_TEST(u"1" == lexical_cast(u'1')); -} #endif +} -#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) void test_char32_conversions() { +// There's no std::ctype in Xcode_15.0.1 +#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) && !defined(__APPLE__) BOOST_TEST(U"100" == lexical_cast(U"100")); BOOST_TEST(U"1" == lexical_cast(U'1')); -} #endif +} void test_getting_pointer_to_function() { @@ -585,12 +587,8 @@ int main() test_char_types_conversions(); operators_overload_test(); -#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) test_char16_conversions(); -#endif -#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS) test_char32_conversions(); -#endif test_getting_pointer_to_function(); return boost::report_errors();