File tree Expand file tree Collapse file tree 4 files changed +27
-10
lines changed
Expand file tree Collapse file tree 4 files changed +27
-10
lines changed Original file line number Diff line number Diff line change 1515
1616#ifdef TEST_INTERNAL_C_API
1717 // gh-135906: Check for compiler warnings in the internal C API.
18- // - Cython uses pycore_frame.h.
18+ // - Cython uses pycore_critical_section.h, pycore_frame.h and
19+ // pycore_template.h.
1920 // - greenlet uses pycore_frame.h, pycore_interpframe_structs.h and
2021 // pycore_interpframe.h.
22+ # include "internal/pycore_critical_section.h"
2123# include "internal/pycore_frame.h"
2224# include "internal/pycore_gc.h"
2325# include "internal/pycore_interp.h"
2426# include "internal/pycore_interpframe.h"
2527# include "internal/pycore_interpframe_structs.h"
2628# include "internal/pycore_object.h"
2729# include "internal/pycore_pystate.h"
30+ # include "internal/pycore_template.h"
2831#endif
2932
3033#ifndef MODULE_NAME
Original file line number Diff line number Diff line change 44import shlex
55import shutil
66import subprocess
7+ import sys
78import unittest
89from test import support
910
2728class BaseTests :
2829 TEST_INTERNAL_C_API = False
2930
30- def test_build (self ):
31- self .check_build ('_testcppext' )
32-
3331 def check_build (self , extension_name , std = None , limited = False ):
3432 venv_dir = 'env'
3533 with support .setup_venv_with_pip_setuptools (venv_dir ) as python_exe :
@@ -91,6 +89,9 @@ def run_cmd(operation, cmd):
9189
9290
9391class TestPublicCAPI (BaseTests , unittest .TestCase ):
92+ def test_build (self ):
93+ self .check_build ('_testcppext' )
94+
9495 @support .requires_gil_enabled ('incompatible with Free Threading' )
9596 def test_build_limited_cpp03 (self ):
9697 self .check_build ('_test_limited_cpp03ext' , std = 'c++03' , limited = True )
@@ -119,6 +120,13 @@ def test_build_cpp14(self):
119120class TestInteralCAPI (BaseTests , unittest .TestCase ):
120121 TEST_INTERNAL_C_API = True
121122
123+ def test_build (self ):
124+ kwargs = {}
125+ if sys .platform == 'darwin' :
126+ # Old Apple clang++ default C++ std is gnu++98
127+ kwargs ['std' ] = 'c++11'
128+ self .check_build ('_testcppext_internal' , ** kwargs )
129+
122130
123131if __name__ == "__main__" :
124132 unittest .main ()
Original file line number Diff line number Diff line change 1515
1616#ifdef TEST_INTERNAL_C_API
1717 // gh-135906: Check for compiler warnings in the internal C API
18+ // - Cython uses pycore_critical_section.h, pycore_frame.h and
19+ // pycore_template.h.
20+ // - greenlet uses pycore_frame.h, pycore_interpframe_structs.h and
21+ // pycore_interpframe.h.
1822# include " internal/pycore_frame.h"
19- // mimalloc emits many compiler warnings when Python is built in debug
20- // mode (when MI_DEBUG is not zero).
21- // mimalloc emits compiler warnings when Python is built on Windows
22- // and macOS .
23- # if !defined(Py_DEBUG) && !defined( MS_WINDOWS) && !defined(__APPLE__ )
23+ # include " internal/pycore_interpframe_structs.h "
24+ # include " internal/pycore_template.h "
25+
26+ // mimalloc emits compiler warnings on Windows .
27+ # if !defined(MS_WINDOWS)
2428# include " internal/pycore_backoff.h"
2529# include " internal/pycore_cell.h"
30+ # include " internal/pycore_critical_section.h"
31+ # include " internal/pycore_interpframe.h"
2632# endif
2733#endif
2834
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ def main():
5959 else :
6060 cppflags .append (f'-std={ std } ' )
6161
62- if limited or (std != 'c++03' ):
62+ if limited or (std != 'c++03' ) and not internal :
6363 # See CPPFLAGS_PEDANTIC docstring
6464 cppflags .extend (CPPFLAGS_PEDANTIC )
6565
You can’t perform that action at this time.
0 commit comments