summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-05 17:46:52 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-05 17:46:52 -0800
commit2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9 (patch)
treee18697cd6f86feb0dfa99ccc0c5357684e6fe75f
parented491cb6677b1f992beae3c8935855aa8f05fb5d (diff)
downloadbinaryen-2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9.tar.gz
binaryen-2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9.tar.bz2
binaryen-2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9.zip
handle expected output from spec test suite
-rwxr-xr-xcheck.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/check.py b/check.py
index c4dbd9429..fee50f5f8 100755
--- a/check.py
+++ b/check.py
@@ -98,9 +98,18 @@ for t in spec_tests:
expected = os.path.join('test', 'spec', 'expected-output', os.path.basename(wast) + '.log')
if os.path.exists(expected):
expected = open(expected).read()
+ # fix it up, our pretty (i32.const 83) must become compared to a homely 83 : i32
+ def fix(x):
+ x = x.strip()
+ if not x: return x
+ v, t = x.split(' : ')
+ return '(' + t + '.const ' + v + ')'
+ expected = '\n'.join(map(fix, expected.split('\n')))
else:
print ' (no expected output)'
continue
+ actual = actual.strip()
+ expected = expected.strip()
if actual != expected:
fail(actual, expected)