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

antocuni at codespeak.net antocuni at codespeak.net
Tue Apr 28 12:00:46 CEST 2009


Author: antocuni
Date: Tue Apr 28 12:00:44 2009
New Revision: 64757

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_runner.py
   pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py
Log:
mark some tests as lltype specific


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/minimal/test/test_runner.py	Tue Apr 28 12:00:44 2009
@@ -23,12 +23,7 @@
 
 
 class TestOOtype(OOJitMixin, MinimalTestMixin, OOtypeBackendTest):
-    def skip(self):
-        py.test.skip('in-progress')
-
-    test_executor = skip
-    test_ooops_non_gc = skip
-
+    pass
 
 class TestLLtype(LLJitMixin, MinimalTestMixin, LLtypeBackendTest):
     pass

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/test/runner.py	Tue Apr 28 12:00:44 2009
@@ -85,8 +85,9 @@
         cpu = self.cpu
         x = execute(cpu, rop.INT_ADD, [BoxInt(100), ConstInt(42)])
         assert x.value == 142
-        s = execute(cpu, rop.NEWSTR, [BoxInt(8)])
-        assert len(s.getptr(lltype.Ptr(rstr.STR)).chars) == 8
+        if self.type_system == 'lltype':
+            s = execute(cpu, rop.NEWSTR, [BoxInt(8)])
+            assert len(s.getptr(lltype.Ptr(rstr.STR)).chars) == 8
 
     def test_lshift(self):
         res = execute(self.cpu, rop.INT_LSHIFT, [BoxInt(10), ConstInt(4)])
@@ -236,19 +237,6 @@
 ##                op = self.cpu.execute_operations(loop, [BoxInt(x), BoxInt(y)])
 ##                assert op.args[0].value == z
 
-    def test_ooops_non_gc(self):
-        x = lltype.malloc(lltype.Struct('x'), flavor='raw')
-        v = self.cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(x))
-        r = self.execute_operation(rop.OOIS, [BoxInt(v), BoxInt(v)], 'int')
-        assert r.value == 1
-        r = self.execute_operation(rop.OOISNOT, [BoxInt(v), BoxInt(v)], 'int')
-        assert r.value == 0
-        r = self.execute_operation(rop.OOISNULL, [BoxInt(v)], 'int')
-        assert r.value == 0
-        r = self.execute_operation(rop.OONONNULL, [BoxInt(v)], 'int')
-        assert r.value == 1
-        lltype.free(x, flavor='raw')
-
 
     def test_passing_guards(self):
         T = self.T
@@ -338,6 +326,19 @@
                                       [BoxInt(res)], 'ptr').value
         assert res2 == x
 
+    def test_ooops_non_gc(self):
+        x = lltype.malloc(lltype.Struct('x'), flavor='raw')
+        v = self.cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(x))
+        r = self.execute_operation(rop.OOIS, [BoxInt(v), BoxInt(v)], 'int')
+        assert r.value == 1
+        r = self.execute_operation(rop.OOISNOT, [BoxInt(v), BoxInt(v)], 'int')
+        assert r.value == 0
+        r = self.execute_operation(rop.OOISNULL, [BoxInt(v)], 'int')
+        assert r.value == 0
+        r = self.execute_operation(rop.OONONNULL, [BoxInt(v)], 'int')
+        assert r.value == 1
+        lltype.free(x, flavor='raw')
+
 
 class OOtypeBackendTest(BaseBackendTest):
 



More information about the Pypy-commit mailing list