diff options
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-x | auto_update_tests.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py index 939d8d278..f4f8d0c1d 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -6,10 +6,16 @@ print '[ processing and updating testcases... ]\n' for asm in sorted(os.listdir('test')): if asm.endswith('.asm.js'): - print '..', asm wasm = asm.replace('.asm.js', '.fromasm') - actual, err = subprocess.Popen([os.path.join('bin', 'asm2wasm'), os.path.join('test', asm)], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() - open(os.path.join('test', wasm), 'w').write(actual) + for precise in [1, 0]: + cmd = [os.path.join('bin', 'asm2wasm'), os.path.join('test', asm)] + if not precise: + cmd += ['--imprecise'] + wasm += '.imprecise' + print '..', asm, wasm + print ' ', ' '.join(cmd) + actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + open(os.path.join('test', wasm), 'w').write(actual) for wasm in sorted(os.listdir('test')): if wasm.endswith('.wast') and os.path.basename(wasm) not in ['kitchen_sink.wast']: # i64s in kitchen_sink @@ -52,6 +58,10 @@ for t in sorted(os.listdir(os.path.join('test', 'print'))): print ' ', ' '.join(cmd) actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() open(os.path.join('test', 'print', wasm + '.txt'), 'w').write(actual) + cmd = [os.path.join('bin', 'binaryen-shell'), os.path.join('test', 'print', t), '--print-minified'] + print ' ', ' '.join(cmd) + actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + open(os.path.join('test', 'print', wasm + '.minified.txt'), 'w').write(actual) for t in sorted(os.listdir(os.path.join('test', 'passes'))): if t.endswith('.wast'): |