[pypy-commit] cffi default: Only run the memory-intensive tests on Linux x86 or x64 machines.

arigo pypy.commits at gmail.com
Wed Sep 20 03:36:35 EDT 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r3020:72b862bbb88e
Date: 2017-09-20 09:36 +0200
http://bitbucket.org/cffi/cffi/changeset/72b862bbb88e/

Log:	Only run the memory-intensive tests on Linux x86 or x64 machines.

diff --git a/testing/cffi0/test_verify.py b/testing/cffi0/test_verify.py
--- a/testing/cffi0/test_verify.py
+++ b/testing/cffi0/test_verify.py
@@ -2455,9 +2455,18 @@
     pt = lib.call2(lib.cb2)
     assert (pt.x, pt.y) == (99*500*999, -99*500*999)
 
+def _only_test_on_linux_intel():
+    if not sys.platform.startswith('linux'):
+        py.test.skip('only running the memory-intensive test on Linux')
+    import platform
+    machine = platform.machine()
+    if 'x86' not in machine and 'x64' not in machine:
+        py.test.skip('only running the memory-intensive test on x86/x64')
+
 def test_ffi_gc_size_arg():
     # with PyPy's GC, these calls to ffi.gc() would rapidly consume
     # 40 GB of RAM without the third argument
+    _only_test_on_linux_intel()
     ffi = FFI()
     ffi.cdef("void *malloc(size_t); void free(void *);")
     lib = ffi.verify(r"""
@@ -2477,6 +2486,7 @@
     # is skipped on CPython, where it eats all the memory.
     if '__pypy__' not in sys.builtin_module_names:
         py.test.skip("find a way to tweak the cyclic GC of CPython")
+    _only_test_on_linux_intel()
     ffi = FFI()
     ffi.cdef("void *malloc(size_t); void free(void *);")
     lib = ffi.verify(r"""
diff --git a/testing/cffi1/test_verify1.py b/testing/cffi1/test_verify1.py
--- a/testing/cffi1/test_verify1.py
+++ b/testing/cffi1/test_verify1.py
@@ -2294,7 +2294,16 @@
     assert ffi.typeof("UINT_PTR") is ffi.typeof(expected)
     assert ffi.typeof("PTSTR") is ffi.typeof("wchar_t *")
 
-def test_gc_pypy_size_arg():
+def _only_test_on_linux_intel():
+    if not sys.platform.startswith('linux'):
+        py.test.skip('only running the memory-intensive test on Linux')
+    import platform
+    machine = platform.machine()
+    if 'x86' not in machine and 'x64' not in machine:
+        py.test.skip('only running the memory-intensive test on x86/x64')
+
+def test_ffi_gc_size_arg():
+    _only_test_on_linux_intel()
     ffi = FFI()
     ffi.cdef("void *malloc(size_t); void free(void *);")
     lib = ffi.verify(r"""
@@ -2316,6 +2325,7 @@
     # is skipped on CPython, where it eats all the memory.
     if '__pypy__' not in sys.builtin_module_names:
         py.test.skip("find a way to tweak the cyclic GC of CPython")
+    _only_test_on_linux_intel()
     ffi = FFI()
     ffi.cdef("void *malloc(size_t); void free(void *);")
     lib = ffi.verify(r"""


More information about the pypy-commit mailing list