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()
# 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
// 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
# 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
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 = [