diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-26 21:40:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-26 21:40:09 -0700 |
commit | ea5b5e20910d8b1773a2adeaad5c92a5f37d0cab (patch) | |
tree | fbb8f3dbd73829a82d70432658ac6e284861589d /auto_update_tests.py | |
parent | ad79b7d1a8773ea08203ebece5da49a432dd8877 (diff) | |
download | binaryen-ea5b5e20910d8b1773a2adeaad5c92a5f37d0cab.tar.gz binaryen-ea5b5e20910d8b1773a2adeaad5c92a5f37d0cab.tar.bz2 binaryen-ea5b5e20910d8b1773a2adeaad5c92a5f37d0cab.zip |
Make wasm-as emit the names section/debug info only with -g (#705)
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-x | auto_update_tests.py | 30 |
1 files changed, 17 insertions, 13 deletions
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' |