[pypy-svn] r18609 - pypy/dist/pypy/rpython/l3interp/test
hpk at codespeak.net
hpk at codespeak.net
Sat Oct 15 13:07:21 CEST 2005
Author: hpk
Date: Sat Oct 15 13:07:21 2005
New Revision: 18609
Modified:
pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py
Log:
(hpk,cfbolz)
refactor and heading towards passing inputargs
Modified: pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py
==============================================================================
--- pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py (original)
+++ pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py Sat Oct 15 13:07:21 2005
@@ -4,6 +4,15 @@
from pypy.translator.translator import Translator
from pypy.annotation import policy
+def translate(func, inputargs):
+ t = Translator(func)
+ pol = policy.AnnotatorPolicy()
+ pol.allow_someobjects = False
+ t.annotate(inputargs, policy=pol)
+ t.specialize()
+ return t.ccompile()
+
+#----------------------------------------------------------------------
def eval_seven():
op = model.Operation(l3interp.LLFrame.op_int_add, 0, [-1, -2])
returnlink = model.ReturnLink(None, [])
@@ -23,11 +32,21 @@
assert result == 7
def test_very_simple_translated():
+ fn = translate(eval_seven, [])
+ assert fn() == 7
+
+#----------------------------------------------------------------------
+
+def Xtest_simple():
+ result = eval_seven()
+ assert result == 7
+
+def Xtest_very_simple_translated():
t = Translator(eval_seven)
pol = policy.AnnotatorPolicy()
pol.allow_someobjects = False
t.annotate([], policy=pol)
t.specialize()
+ t.view()
fn = t.ccompile()
- assert fn() == 7
More information about the Pypy-commit
mailing list