From 2c4a72b3148700d2a5175c6af5cbe3f9378b3dc1 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 14 Jan 2016 16:42:38 -0800 Subject: add expected outputs from text->binary->text test --- auto_update_tests.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'auto_update_tests.py') diff --git a/auto_update_tests.py b/auto_update_tests.py index 597bb5901..ee7d15d18 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -68,5 +68,23 @@ for t in sorted(os.listdir(os.path.join('test', 'passes'))): actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() open(os.path.join('test', 'passes', passname + '.txt'), 'w').write(actual) +print '\n[ checking binary format testcases... ]\n' + +for wast in sorted(os.listdir('test')): + if wast.endswith('.wast') and not wast in ['unit.wast']: # blacklist some known failures + cmd = [os.path.join('bin', 'wasm-as'), os.path.join('test', wast), '-o', 'a.wasm'] + print ' '.join(cmd) + if os.path.exists('a.wasm'): os.unlink('a.wasm') + subprocess.check_call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + assert os.path.exists('a.wasm') + + cmd = [os.path.join('bin', 'wasm-dis'), 'a.wasm', '-o', 'a.wast'] + print ' '.join(cmd) + if os.path.exists('a.wast'): os.unlink('a.wast') + subprocess.check_call(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + assert os.path.exists('a.wast') + actual = open('a.wast').read() + open(os.path.join('test', wast + '.fromBinary'), 'w').write(actual) + print '\n[ success! ]' -- cgit v1.2.3