diff options
-rw-r--r-- | Lib/test/test_cppext/__init__.py (renamed from Lib/test/test_cppext.py) | 8 | ||||
-rw-r--r-- | Lib/test/test_cppext/extension.cpp (renamed from Lib/test/_testcppext.cpp) | 2 | ||||
-rw-r--r-- | Lib/test/test_cppext/setup.py (renamed from Lib/test/setup_testcppext.py) | 4 | ||||
-rw-r--r-- | Makefile.pre.in | 1 |
4 files changed, 8 insertions, 7 deletions
diff --git a/Lib/test/test_cppext.py b/Lib/test/test_cppext/__init__.py index 465894d..4ce29b7 100644 --- a/Lib/test/test_cppext.py +++ b/Lib/test/test_cppext/__init__.py @@ -10,9 +10,7 @@ from test.support import os_helper MS_WINDOWS = (sys.platform == 'win32') - - -SETUP_TESTCPPEXT = support.findfile('setup_testcppext.py') +SETUP = os.path.join(os.path.dirname(__file__), 'setup.py') @support.requires_subprocess() @@ -74,14 +72,14 @@ class TestCPPExt(unittest.TestCase): # Build the C++ extension cmd = [python, '-X', 'dev', - SETUP_TESTCPPEXT, 'build_ext', '--verbose'] + SETUP, 'build_ext', '--verbose'] if std_cpp03: cmd.append('-std=c++03') run_cmd('Build', cmd) # Install the C++ extension cmd = [python, '-X', 'dev', - SETUP_TESTCPPEXT, 'install'] + SETUP, 'install'] run_cmd('Install', cmd) # Do a reference run. Until we test that running python diff --git a/Lib/test/_testcppext.cpp b/Lib/test/test_cppext/extension.cpp index 0e381a7..58d18ea 100644 --- a/Lib/test/_testcppext.cpp +++ b/Lib/test/test_cppext/extension.cpp @@ -1,5 +1,7 @@ // gh-91321: Very basic C++ test extension to check that the Python C API is // compatible with C++ and does not emit C++ compiler warnings. +// +// The code is only built, not executed. // Always enable assertions #undef NDEBUG diff --git a/Lib/test/setup_testcppext.py b/Lib/test/test_cppext/setup.py index c6b6810..dac3a96 100644 --- a/Lib/test/setup_testcppext.py +++ b/Lib/test/test_cppext/setup.py @@ -1,7 +1,7 @@ # gh-91321: Build a basic C++ test extension to check that the Python C API is # compatible with C++ and does not emit C++ compiler warnings. +import os.path import sys -from test import support from setuptools import setup, Extension @@ -9,7 +9,7 @@ from setuptools import setup, Extension MS_WINDOWS = (sys.platform == 'win32') -SOURCE = support.findfile('_testcppext.cpp') +SOURCE = os.path.join(os.path.dirname(__file__), 'extension.cpp') if not MS_WINDOWS: # C++ compiler flags for GCC and clang CPPFLAGS = [ diff --git a/Makefile.pre.in b/Makefile.pre.in index 6405d06..884bea1 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1959,6 +1959,7 @@ TESTSUBDIRS= ctypes/test \ test/support \ test/test_asyncio \ test/test_capi \ + test/test_cppext \ test/test_email \ test/test_email/data \ test/test_import \ |