From 65c5502a81d5704e2fbc57dbac75e1b759252941 Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Sat, 7 Dec 2024 16:51:43 +0100 Subject: [PATCH] ci: move to macos13 macos12 CI is gone --- .github/workflows/tests.yml | 4 ++-- tests/test_remove_template_defaults.py | 9 ++++++++- tests/test_source_reader.py | 6 ++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c68ef7a..a3b5f842 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,7 +70,7 @@ jobs: castxml-epic: 1 cppstd: "-std=c++11" - - os: macos-12 + - os: macos-13 compiler: xcode version: "default" python-version: "3.8" @@ -96,7 +96,7 @@ jobs: run: | wget -q -O - https://data.kitware.com/api/v1/file/hashsum/sha512/bdbb67a10c5f8d1b738cd19cb074f409d4803e8077cb8c1072ef4eaf738fa871a73643f9c8282d58cae28d188df842c82ad6620b6d590b0396a0172a27438dce/download | tar zxf - -C ~/ - name: Setup castxml for Mac - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' run: | wget -q -O - https://data.kitware.com/api/v1/file/hashsum/sha512/5d937e938f7b882a3a3e7941e68f8312d0898aaf2082e00003dd362b1ba70b98b0a08706a1be28e71652a6a0f1e66f89768b5eaa20e5a100592d5b3deefec3f0/download | tar zxf - -C ~/ - name: Run tests diff --git a/tests/test_remove_template_defaults.py b/tests/test_remove_template_defaults.py index b1706c4c..5f5024a4 100644 --- a/tests/test_remove_template_defaults.py +++ b/tests/test_remove_template_defaults.py @@ -3,6 +3,8 @@ # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt +import platform + import pytest from . import autoconfig @@ -20,7 +22,12 @@ def global_ns(): COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE config = autoconfig.cxx_parsers_cfg.config.clone() - config.cflags = "-std=c++11" + if platform.system() == "Darwin": + config.cflags = "-std=c++11 -Dat_quick_exit=atexit -Dquick_exit=exit" + # https://fr.mathworks.com/matlabcentral/answers/2013982-clibgen-generatelibrarydefinition-error-the-global-scope-has-no-quick_exit-on-mac-m2#answer_1439856 + # https://github.com/jetbrains/kotlin/commit/d50f585911dedec5723213da8835707ac95e1c01 + else: + config.cflags = "-std=c++11" decls = parser.parse(TEST_FILES, config, COMPILATION_MODE) global_ns = declarations.get_global_namespace(decls) global_ns.init_optimizer() diff --git a/tests/test_source_reader.py b/tests/test_source_reader.py index 355e225e..20e403a6 100644 --- a/tests/test_source_reader.py +++ b/tests/test_source_reader.py @@ -3,6 +3,8 @@ # Distributed under the Boost Software License, Version 1.0. # See http://www.boost.org/LICENSE_1_0.txt +import platform + import pytest from . import autoconfig @@ -19,6 +21,10 @@ def global_ns(): COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE config = autoconfig.cxx_parsers_cfg.config.clone() + if platform.system() == "Darwin": + config.cflags = "-Dat_quick_exit=atexit -Dquick_exit=exit" + # https://fr.mathworks.com/matlabcentral/answers/2013982-clibgen-generatelibrarydefinition-error-the-global-scope-has-no-quick_exit-on-mac-m2#answer_1439856 + # https://github.com/jetbrains/kotlin/commit/d50f585911dedec5723213da8835707ac95e1c01 decls = parser.parse(TEST_FILES, config, COMPILATION_MODE) global_ns = declarations.get_global_namespace(decls) global_ns.init_optimizer()