[pypy-svn] r67423 - pypy/trunk/pypy/module/pypyjit/test
pedronis at codespeak.net
pedronis at codespeak.net
Wed Sep 2 11:13:05 CEST 2009
Author: pedronis
Date: Wed Sep 2 11:13:04 2009
New Revision: 67423
Modified:
pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py
Log:
let's throw away recent new code because we like perturbation
Modified: pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py (original)
+++ pypy/trunk/pypy/module/pypyjit/test/test_pypy_c.py Wed Sep 2 11:13:04 2009
@@ -1,20 +1,8 @@
from pypy.conftest import gettestobjspace, option
from pypy.tool.udir import udir
-from pypy.jit.backend import loopparser
import py
import sys, os
-def run_source(sourcefile, pypy_executable, tmpdir):
- logfilepath = tmpdir.join(sourcefile.basename[:-3] + '.log')
- if sys.platform.startswith('win'):
- py.test.skip("XXX this is not Windows-friendly")
-
- result = py.process.cmdexec('PYPYJITLOG="%s" "%s" "%s"' % (
- logfilepath, pypy_executable, sourcefile))
- assert result
- assert logfilepath.check()
- return result, logfilepath + '.ops'
-
class PyPyCJITTests(object):
def run_source(self, source, testcases):
source = py.code.Source(source)
@@ -144,35 +132,3 @@
cls.tmpdir.ensure(dir=1)
cls.counter = 0
cls.pypy_c = option.pypy_c
-
- def run_and_compare(self, sourcefile):
- fname = py.magic.autopath().dirpath().join('loops', sourcefile)
- pypy_out, log = run_source(fname, self.pypy_c, self.tmpdir)
- cpy_out = py.process.cmdexec('"%s" "%s"' % (
- sys.executable, fname))
- assert pypy_out == cpy_out
- parser = loopparser.Parser()
- loops = parser.parse(log)
- if option.view:
- from pypy.jit.metainterp.graphpage import display_loops
- display_loops(loops)
- return loops
-
- def assert_no_op(self, loop, opname):
- for operation in loop.iter_operations():
- assert operation.opname != opname
-
- def test_trivial_add(self):
- loops = self.run_and_compare('simple_add.py')
- for loop in loops:
- # naive way if finding the relevant loop to inspect
- if isinstance(loop.operations[0], loopparser.ByteCodeRef):
- self.assert_no_op(loop, 'call')
- break
- else:
- assert False
-
- def test_dict_lookup(self):
- py.test.skip('should remove dict lookups')
- loops = self.run_and_compare('dict_lookup.py')
- self.assert_no_op(loops[1], 'getfield_gc')
More information about the Pypy-commit
mailing list