[pypy-svn] pypy jitypes2: hg merge default
antocuni
commits-noreply at bitbucket.org
Tue Jan 18 16:35:21 CET 2011
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: jitypes2
Changeset: r40875:5c6c563200bb
Date: 2011-01-18 16:29 +0100
http://bitbucket.org/pypy/pypy/changeset/5c6c563200bb/
Log: hg merge default
diff --git a/pypy/jit/metainterp/test/test_optimizeopt.py b/pypy/jit/metainterp/test/test_optimizeopt.py
--- a/pypy/jit/metainterp/test/test_optimizeopt.py
+++ b/pypy/jit/metainterp/test/test_optimizeopt.py
@@ -552,21 +552,46 @@
"""
self.optimize_loop(ops, expected, preamble)
+ def test_bound_int_is_true(self):
+ ops = """
+ [i0]
+ i1 = int_add(i0, 1)
+ i2 = int_gt(i1, 0)
+ guard_true(i2) []
+ i3 = int_is_true(i1)
+ guard_true(i3) []
+ jump(i1)
+ """
+ expected = """
+ [i0]
+ i1 = int_add(i0, 1)
+ jump(i1)
+ """
+ preamble = """
+ [i0]
+ i1 = int_add(i0, 1)
+ i2 = int_gt(i1, 0)
+ guard_true(i2) []
+ jump(i1)
+ """
+ self.optimize_loop(ops, expected, preamble)
+
def test_int_is_true_is_zero(self):
- py.test.skip("XXX implement me")
ops = """
[i0]
- i1 = int_is_true(i0)
- guard_true(i1) []
- i2 = int_is_zero(i0)
- guard_false(i2) []
- jump(i0)
+ i1 = int_add(i0, 1)
+ i2 = int_is_true(i1)
+ guard_true(i2) []
+ i3 = int_is_zero(i1)
+ guard_false(i3) []
+ jump(i1)
"""
expected = """
[i0]
- i1 = int_is_true(i0)
- guard_true(i1) []
- jump(i0)
+ i1 = int_add(i0, 1)
+ i2 = int_is_true(i1)
+ guard_true(i2) []
+ jump(i1)
"""
self.optimize_loop(ops, expected)
diff --git a/lib-python/conftest.py b/lib-python/conftest.py
--- a/lib-python/conftest.py
+++ b/lib-python/conftest.py
@@ -36,7 +36,9 @@
group.addoption('--pypy', action="store", type="string",
dest="pypy", help="use given pypy executable to run lib-python tests. "
"This will run the tests directly (i.e. not through py.py)")
-
+ group.addoption('--filter', action="store", type="string", default=None,
+ dest="unittest_filter", help="Similar to -k, XXX")
+
option = py.test.config.option
def gettimeout():
@@ -687,7 +689,14 @@
else:
status = 'abnormal termination 0x%x' % status
else:
- status = os.system("%s >>%s 2>>%s" %(cmd, stdout, stderr))
+ if self.config.option.unittest_filter is not None:
+ cmd += ' --filter %s' % self.config.option.unittest_filter
+ if self.config.option.usepdb:
+ cmd += ' --pdb'
+ if self.config.option.capture == 'no':
+ status = os.system(cmd)
+ else:
+ status = os.system("%s >>%s 2>>%s" %(cmd, stdout, stderr))
if os.WIFEXITED(status):
status = os.WEXITSTATUS(status)
else:
More information about the Pypy-commit
mailing list