]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-127906: Backport test_cppext changes from the main branch (#127914)
authorVictor Stinner <vstinner@python.org>
Fri, 13 Dec 2024 12:51:48 +0000 (13:51 +0100)
committerGitHub <noreply@github.com>
Fri, 13 Dec 2024 12:51:48 +0000 (12:51 +0000)
Lib/test/test_cppext/__init__.py
Lib/test/test_cppext/setup.py

index 00a2840d49c77955593f0acb9f6e27eacb458474..efd79448c6610453af07c7cd2eb7aab768891667 100644 (file)
@@ -76,6 +76,8 @@ class TestCPPExt(unittest.TestCase):
         cmd = [python_exe, '-X', 'dev',
                '-m', 'pip', 'install', '--no-build-isolation',
                os.path.abspath(pkg_dir)]
+        if support.verbose:
+            cmd.append('-v')
         run_cmd('Install', cmd)
 
         # Do a reference run. Until we test that running python
index 80b3e0d5212f7bf84431351f3b433c469ec4bcc1..d97b238b8d147726b09790ef824c9fd3d97ac381 100644 (file)
@@ -10,6 +10,7 @@ from setuptools import setup, Extension
 
 
 SOURCE = 'extension.cpp'
+
 if not support.MS_WINDOWS:
     # C++ compiler flags for GCC and clang
     CPPFLAGS = [
@@ -19,8 +20,13 @@ if not support.MS_WINDOWS:
         '-Werror',
     ]
 else:
-    # Don't pass any compiler flag to MSVC
-    CPPFLAGS = []
+    # MSVC compiler flags
+    CPPFLAGS = [
+        # Display warnings level 1 to 4
+        '/W4',
+        # Treat all compiler warnings as compiler errors
+        '/WX',
+    ]
 
 
 def main():