From 23f28802796080813f0e806248a91a9ad5fc6275 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 4 Dec 2015 21:40:14 -0800 Subject: add first working wasm2asm testcase --- check.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'check.py') diff --git a/check.py b/check.py index cab2d5445..a0517aff5 100755 --- a/check.py +++ b/check.py @@ -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) -- cgit v1.2.3