diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-12-04 21:40:14 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-12-04 21:40:14 -0800 |
commit | 23f28802796080813f0e806248a91a9ad5fc6275 (patch) | |
tree | d572509b0e4b48920a208c3a5f48f93e469d2215 /check.py | |
parent | 56c1189004dbfa1713dfe418c322906403402d60 (diff) | |
download | binaryen-23f28802796080813f0e806248a91a9ad5fc6275.tar.gz binaryen-23f28802796080813f0e806248a91a9ad5fc6275.tar.bz2 binaryen-23f28802796080813f0e806248a91a9ad5fc6275.zip |
add first working wasm2asm testcase
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -76,18 +76,19 @@ for asm in tests: print '\n[ checking wasm2asm testcases... ]\n' -for wasm in []:#tests: +for wasm in ['min.wast']: if wasm.endswith('.wast'): print '..', wasm - asm = asm.replace('.wast', '.wasm2asm.js') + asm = wasm.replace('.wast', '.wasm2asm.js') actual, err = subprocess.Popen([os.path.join('bin', 'wasm2asm'), os.path.join('test', wasm)], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() assert err == '', 'bad err:' + err # verify output - if not os.path.exists(os.path.join('test', asm)): + expected_file = os.path.join('test', asm) + if not os.path.exists(expected_file): print actual - raise Exception('output .wast file does not exist') - expected = open(os.path.join('test', aasm)).read() + raise Exception('output ' + expected_file + ' does not exist') + expected = open(expected_file).read() if actual != expected: fail(actual, expected) |