[pypy-svn] r64779 - in pypy/branch/pyjitpl5/pypy/jit/backend: minimal/test test

antocuni at codespeak.net antocuni at codespeak.net
Tue Apr 28 16:17:01 CEST 2009


Author: antocuni
Date: Tue Apr 28 16:17:01 2009
New Revision: 64779

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_exception.py
   pypy/branch/pyjitpl5/pypy/jit/backend/test/support.py
Log:
write a mixin to compile to cli.  ootype tests of the minimal backend are
still disabled because they miserably fail



Modified: pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_exception.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_exception.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_zrpy_exception.py	Tue Apr 28 16:17:01 2009
@@ -1,6 +1,6 @@
 import py
 from pypy.jit.backend.minimal.runner import LLtypeCPU, OOtypeCPU
-from pypy.jit.backend.test.support import CCompiledMixin
+from pypy.jit.backend.test.support import CCompiledMixin, CliCompiledMixin
 from pypy.jit.metainterp.test import test_zrpy_exception
 
 class LLTranslatedJitMixin(CCompiledMixin):
@@ -12,6 +12,18 @@
         return CCompiledMixin.meta_interp(self, *args, **kwds)
 
 
+class OOTranslatedJitMixin(CliCompiledMixin):
+    CPUClass = OOtypeCPU
+
+    def meta_interp(self, *args, **kwds):
+        from pypy.jit.metainterp.simple_optimize import Optimizer
+        kwds['optimizer'] = Optimizer
+        return CliCompiledMixin.meta_interp(self, *args, **kwds)
+
+
+## class TestOOtype(OOTranslatedJitMixin, test_zrpy_exception.TestLLExceptions):
+##     pass
+
 class TestLLtype(LLTranslatedJitMixin, test_zrpy_exception.TestLLExceptions):
     # for the individual tests see
     # ====> ../../../metainterp/test/test_exception.py

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/test/support.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/test/support.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/test/support.py	Tue Apr 28 16:17:01 2009
@@ -90,3 +90,11 @@
         res = int(stdout)
         log('---------- Test done (%d) ----------' % (res,))
         return res
+
+class CliCompiledMixin(BaseCompiledMixin):
+    type_system = 'ootype'
+
+    def _compile_and_run(self, t, entry_point, entry_point_graph, args):
+        from pypy.translator.cli.test.runtest import compile_graph, get_annotation
+        func = compile_graph(entry_point_graph, t, nowrap=True)
+        return func(*args)



More information about the Pypy-commit mailing list