[pypy-commit] cffi cffi-1.0: keep this from test_verify.py

arigo noreply at buildbot.pypy.org
Sat Apr 18 17:33:24 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1760:0528f5ac101b
Date: 2015-04-18 17:29 +0200
http://bitbucket.org/cffi/cffi/changeset/0528f5ac101b/

Log:	keep this from test_verify.py

diff --git a/new/test_verify1.py b/new/test_verify1.py
--- a/new/test_verify1.py
+++ b/new/test_verify1.py
@@ -2,6 +2,27 @@
 from cffi1 import FFI, VerificationError, model
 
 lib_m = ['m']
+if sys.platform == 'win32':
+    #there is a small chance this fails on Mingw via environ $CC
+    import distutils.ccompiler
+    if distutils.ccompiler.get_default_compiler() == 'msvc':
+        lib_m = ['msvcrt']
+    pass      # no obvious -Werror equivalent on MSVC
+else:
+    if (sys.platform == 'darwin' and
+          [int(x) for x in os.uname()[2].split('.')] >= [11, 0, 0]):
+        # assume a standard clang or gcc
+        extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
+        # special things for clang
+        extra_compile_args.append('-Qunused-arguments')
+    else:
+        # assume a standard gcc
+        extra_compile_args = ['-Werror', '-Wall', '-Wextra', '-Wconversion']
+
+    class FFI(FFI):
+        def verify(self, *args, **kwds):
+            return super(FFI, self).verify(
+                *args, extra_compile_args=extra_compile_args, **kwds)
 
 
 def test_missing_function(ffi=None):


More information about the pypy-commit mailing list