Skip to content

Commit 7b1ded9

Browse files
committedJan 11, 2025··
tests: fix some tests on macOS
Fixes: /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:144:9: error: no member named 'at_quick_exit' in the global namespace using ::at_quick_exit _LIBCPP_USING_IF_EXISTS; ~~^ /Applications/Xcode_15.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstdlib:145:9: error: no member named 'quick_exit' in the global namespace using ::quick_exit _LIBCPP_USING_IF_EXISTS; ~~^
1 parent ea300f6 commit 7b1ded9

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed
 

‎tests/test_map_gcc5.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Distributed under the Boost Software License, Version 1.0.
44
# See http://www.boost.org/LICENSE_1_0.txt
55

6+
import platform
7+
68
from . import autoconfig
79

810
from pygccxml import parser
@@ -22,7 +24,12 @@ def test_map_gcc5():
2224
"""
2325

2426
config = autoconfig.cxx_parsers_cfg.config.clone()
25-
config.cflags = "-std=c++11"
27+
if platform.system() == "Darwin":
28+
config.cflags = "-std=c++11 -Dat_quick_exit=atexit -Dquick_exit=exit"
29+
# https://fr.mathworks.com/matlabcentral/answers/2013982-clibgen-generatelibrarydefinition-error-the-global-scope-has-no-quick_exit-on-mac-m2#answer_1439856
30+
# https://github.com/jetbrains/kotlin/commit/d50f585911dedec5723213da8835707ac95e1c01
31+
else:
32+
config.cflags = "-std=c++11"
2633

2734
decls = parser.parse(TEST_FILES, config)
2835
global_ns = declarations.get_global_namespace(decls)

‎tests/test_pattern_parser.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# See http://www.boost.org/LICENSE_1_0.txt
55

66
import pytest
7+
import platform
78

89
from . import autoconfig
910

@@ -20,7 +21,12 @@
2021
def global_ns():
2122
COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE
2223
config = autoconfig.cxx_parsers_cfg.config.clone()
23-
config.cflags = "-std=c++11"
24+
if platform.system() == "Darwin":
25+
config.cflags = "-std=c++11 -Dat_quick_exit=atexit -Dquick_exit=exit"
26+
# https://fr.mathworks.com/matlabcentral/answers/2013982-clibgen-generatelibrarydefinition-error-the-global-scope-has-no-quick_exit-on-mac-m2#answer_1439856
27+
# https://github.com/jetbrains/kotlin/commit/d50f585911dedec5723213da8835707ac95e1c01
28+
else:
29+
config.cflags = "-std=c++11"
2430
decls = parser.parse(TEST_FILES, config, COMPILATION_MODE)
2531
global_ns = declarations.get_global_namespace(decls)
2632
global_ns.init_optimizer()

‎tests/test_smart_pointer.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# See http://www.boost.org/LICENSE_1_0.txt
55

66
import pytest
7+
import platform
78

89
from . import autoconfig
910

@@ -20,7 +21,12 @@
2021
def global_ns():
2122
COMPILATION_MODE = parser.COMPILATION_MODE.ALL_AT_ONCE
2223
config = autoconfig.cxx_parsers_cfg.config.clone()
23-
config.cflags = "-std=c++11"
24+
if platform.system() == "Darwin":
25+
config.cflags = "-std=c++11 -Dat_quick_exit=atexit -Dquick_exit=exit"
26+
# https://fr.mathworks.com/matlabcentral/answers/2013982-clibgen-generatelibrarydefinition-error-the-global-scope-has-no-quick_exit-on-mac-m2#answer_1439856
27+
# https://github.com/jetbrains/kotlin/commit/d50f585911dedec5723213da8835707ac95e1c01
28+
else:
29+
config.cflags = "-std=c++11"
2430
decls = parser.parse(TEST_FILES, config, COMPILATION_MODE)
2531
global_ns = declarations.get_global_namespace(decls)
2632
global_ns.init_optimizer()

0 commit comments

Comments
 (0)
Please sign in to comment.