From ea5b5e20910d8b1773a2adeaad5c92a5f37d0cab Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 26 Sep 2016 21:40:09 -0700 Subject: Make wasm-as emit the names section/debug info only with -g (#705) --- auto_update_tests.py | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'auto_update_tests.py') diff --git a/auto_update_tests.py b/auto_update_tests.py index 26c12e2c0..e0a057fc3 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -93,19 +93,23 @@ print '\n[ checking binary format testcases... ]\n' for wast in sorted(os.listdir('test')): if wast.endswith('.wast') and not wast in []: # 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() - with open(os.path.join('test', wast + '.fromBinary'), 'w') as o: o.write(actual) + for debug_info in [0, 1]: + cmd = [os.path.join('bin', 'wasm-as'), os.path.join('test', wast), '-o', 'a.wasm'] + if debug_info: cmd += ['-g'] + 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() + binary_name = wast + '.fromBinary' + if not debug_info: binary_name += '.noDebugInfo' + with open(os.path.join('test', binary_name), 'w') as o: o.write(actual) print '\n[ checking example testcases... ]\n' -- cgit v1.2.3