diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-05 17:46:52 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-05 17:46:52 -0800 |
commit | 2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9 (patch) | |
tree | e18697cd6f86feb0dfa99ccc0c5357684e6fe75f | |
parent | ed491cb6677b1f992beae3c8935855aa8f05fb5d (diff) | |
download | binaryen-2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9.tar.gz binaryen-2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9.tar.bz2 binaryen-2ad311f635c3d2d545283255cfdf1e7c0f4c7bc9.zip |
handle expected output from spec test suite
-rwxr-xr-x | check.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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) |