[pypy-svn] r53662 - in pypy/branch/io-improvements/pypy/rpython: . module/test test
fijal at codespeak.net
fijal at codespeak.net
Thu Apr 10 17:47:03 CEST 2008
Author: fijal
Date: Thu Apr 10 17:47:02 2008
New Revision: 53662
Modified:
pypy/branch/io-improvements/pypy/rpython/llinterp.py
pypy/branch/io-improvements/pypy/rpython/module/test/test_posix.py
pypy/branch/io-improvements/pypy/rpython/test/test_llinterp.py
pypy/branch/io-improvements/pypy/rpython/test/tool.py
Log:
Another bunch of posix tests, run with a flag moving_gc=False.
Modified: pypy/branch/io-improvements/pypy/rpython/llinterp.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/llinterp.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/llinterp.py Thu Apr 10 17:47:02 2008
@@ -43,7 +43,7 @@
""" low level interpreter working with concrete values. """
def __init__(self, typer, tracing=True, exc_data_ptr=None,
- malloc_check=True):
+ malloc_check=True, moving_gc=True):
self.bindings = {}
self.typer = typer
# 'heap' is module or object that provides malloc, etc for lltype ops
@@ -54,6 +54,7 @@
self.malloc_check = malloc_check
self.frame_class = LLFrame
self.mallocs = {}
+ self.moving_gc = moving_gc
if tracing:
self.tracer = Tracer()
@@ -754,7 +755,7 @@
self.heap.collect()
def op_gc_can_move(self, p):
- return True
+ return self.moving_gc
def op_gc__disable_finalizers(self):
self.heap.disable_finalizers()
Modified: pypy/branch/io-improvements/pypy/rpython/module/test/test_posix.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/module/test/test_posix.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/module/test/test_posix.py Thu Apr 10 17:47:02 2008
@@ -151,6 +151,9 @@
class TestLLtype(BaseTestPosix, LLRtypeMixin):
pass
+class TestLLtypeNonMovingGc(BaseTestPosix, LLRtypeMixin):
+ MOVING_GV = False
+
class TestOOtype(BaseTestPosix, OORtypeMixin):
def test_fstat(self):
py.test.skip("ootypesystem does not support os.fstat")
Modified: pypy/branch/io-improvements/pypy/rpython/test/test_llinterp.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/test/test_llinterp.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/test/test_llinterp.py Thu Apr 10 17:47:02 2008
@@ -72,7 +72,8 @@
def get_interpreter(func, values, view='auto', viewbefore='auto', policy=None,
someobjects=False, type_system="lltype", backendopt=False,
- config=None, malloc_check=True, **extraconfigopts):
+ config=None, malloc_check=True,
+ moving_gc=True, **extraconfigopts):
extra_key = [(key, value) for key, value in extraconfigopts.iteritems()]
extra_key.sort()
extra_key = tuple(extra_key)
@@ -97,7 +98,8 @@
viewbefore, policy, type_system=type_system,
backendopt=backendopt, config=config,
**extraconfigopts)
- interp = LLInterpreter(typer, malloc_check=malloc_check)
+ interp = LLInterpreter(typer, malloc_check=malloc_check,
+ moving_gc=moving_gc)
_tcache[key] = (t, interp, graph)
# keep the cache small
_lastinterpreted.append(key)
@@ -111,11 +113,12 @@
def interpret(func, values, view='auto', viewbefore='auto', policy=None,
someobjects=False, type_system="lltype", backendopt=False,
- config=None, malloc_check=True):
+ config=None, malloc_check=True, moving_gc=True):
interp, graph = get_interpreter(func, values, view, viewbefore, policy,
someobjects, type_system=type_system,
backendopt=backendopt, config=config,
- malloc_check=malloc_check)
+ malloc_check=malloc_check,
+ moving_gc=moving_gc)
result = interp.eval_graph(graph, values)
if malloc_check and interp.mallocs:
raise MallocMismatch(interp.mallocs)
@@ -123,10 +126,11 @@
def interpret_raises(exc, func, values, view='auto', viewbefore='auto',
policy=None, someobjects=False, type_system="lltype",
- backendopt=False):
+ backendopt=False, moving_gc=True):
interp, graph = get_interpreter(func, values, view, viewbefore, policy,
someobjects, type_system=type_system,
- backendopt=backendopt)
+ backendopt=backendopt,
+ moving_gc=moving_gc)
info = py.test.raises(LLException, "interp.eval_graph(graph, values)")
try:
got = interp.find_exception(info.value)
Modified: pypy/branch/io-improvements/pypy/rpython/test/tool.py
==============================================================================
--- pypy/branch/io-improvements/pypy/rpython/test/tool.py (original)
+++ pypy/branch/io-improvements/pypy/rpython/test/tool.py Thu Apr 10 17:47:02 2008
@@ -6,6 +6,7 @@
class BaseRtypingTest(object):
FLOAT_PRECISION = 8
+ MOVING_GC = True
def gengraph(self, func, argtypes=[], viewbefore='auto', policy=None,
backendopt=False, config=None):
@@ -13,10 +14,12 @@
backendopt=backendopt, config=config)
def interpret(self, fn, args, **kwds):
- return interpret(fn, args, type_system=self.type_system, **kwds)
+ return interpret(fn, args, type_system=self.type_system,
+ moving_gc=self.MOVING_GC, **kwds)
def interpret_raises(self, exc, fn, args, **kwds):
- return interpret_raises(exc, fn, args, type_system=self.type_system, **kwds)
+ return interpret_raises(exc, fn, args, type_system=self.type_system,
+ moving_gc=self.MOVING_GC, **kwds)
def float_eq(self, x, y):
return x == y
@@ -40,7 +43,7 @@
if skipLL and self.type_system == 'lltype':
py.test.skip("lltypesystem doesn't support %s, yet" % reason)
if skipOO and self.type_system == 'ootype':
- py.test.skip("ootypesystem doesn't support %s, yet" % reason)
+ py.test.skip("ootypesystem doesn't support %s, yet" % reason)
class LLRtypeMixin(object):
type_system = 'lltype'
More information about the Pypy-commit
mailing list