[pypy-svn] r51230 - pypy/branch/asmgcroot/pypy/translator/c/gcc/test
arigo at codespeak.net
arigo at codespeak.net
Sun Feb 3 19:09:38 CET 2008
Author: arigo
Date: Sun Feb 3 19:09:36 2008
New Revision: 51230
Modified:
pypy/branch/asmgcroot/pypy/translator/c/gcc/test/test_trackgcroot.py
Log:
Check that the expected global labels are added.
Modified: pypy/branch/asmgcroot/pypy/translator/c/gcc/test/test_trackgcroot.py
==============================================================================
--- pypy/branch/asmgcroot/pypy/translator/c/gcc/test/test_trackgcroot.py (original)
+++ pypy/branch/asmgcroot/pypy/translator/c/gcc/test/test_trackgcroot.py Sun Feb 3 19:09:36 2008
@@ -52,6 +52,7 @@
print
print path.basename
lines = path.readlines()
+ expectedlines = lines[:]
tracker = FunctionGcRootTracker(lines)
tracker.is_main = tracker.funcname == 'main'
table = tracker.computegcmaptable(verbose=sys.maxint)
@@ -62,7 +63,7 @@
tabledict[entry[0]] = entry[1]
# find the ";; expected" lines
prevline = ""
- for line in lines:
+ for i, line in enumerate(lines):
match = r_expected.match(line)
if match:
expected = eval(match.group(1))
@@ -74,7 +75,10 @@
got = tabledict[label]
assert got == expected
seen[label] = True
+ expectedlines.insert(i-2, '\t.globl\t%s\n' % (label,))
+ expectedlines.insert(i-1, '%s:\n' % (label,))
prevline = line
assert len(seen) == len(tabledict), (
"computed table contains unexpected entries:\n%r" %
[key for key in tabledict if key not in seen])
+ assert lines == expectedlines
More information about the Pypy-commit
mailing list