[pypy-svn] pypy default: the only supported way to run these tests is `pypy-c py.test ...`, because we need to disassemble the snippets with the very same pypy used for JITting them

antocuni commits-noreply at bitbucket.org
Fri Feb 18 13:54:32 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r42152:60b09f3d13a5
Date: 2011-02-17 16:04 +0100
http://bitbucket.org/pypy/pypy/changeset/60b09f3d13a5/

Log:	the only supported way to run these tests is `pypy-c py.test ...`,
	because we need to disassemble the snippets with the very same pypy
	used for JITting them

diff --git a/pypy/module/pypyjit/test/test_pypy_c_new.py b/pypy/module/pypyjit/test/test_pypy_c_new.py
--- a/pypy/module/pypyjit/test/test_pypy_c_new.py
+++ b/pypy/module/pypyjit/test/test_pypy_c_new.py
@@ -9,13 +9,10 @@
 
 class BaseTestPyPyC(object):
     def setup_class(cls):
-        from pypy.conftest import option
-        from pypy.module.pypyjit.test.test_pypy_c import has_info
-        if option.pypy_c is None:
-            py.test.skip("pass --pypy!")
-        if not has_info(option.pypy_c, 'translation.jit'):
+        if '__pypy__' not in sys.builtin_module_names:
+            py.test.skip("must run this test with pypy")
+        if not sys.pypy_translation_info['translation.jit']:
             py.test.skip("must give a pypy-c with the jit enabled")
-        cls.pypy_c = option.pypy_c
         cls.tmpdir = udir.join('test-pypy-jit')
         cls.tmpdir.ensure(dir=True)
 
@@ -51,7 +48,7 @@
             f.write(str(py.code.Source(func)) + "\n")
             f.write("print %s()\n" % func.func_name)
         logfile = self.filepath.new(ext='.log')
-        pipe = subprocess.Popen([self.pypy_c, str(self.filepath)],
+        pipe = subprocess.Popen([sys.executable, str(self.filepath)],
                                 stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                 env={'PYPYLOG': "jit-log-opt,jit-summary:" + str(logfile)})
         pipe.wait()


More information about the Pypy-commit mailing list