diff options
-rwxr-xr-x | auto_update_tests.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py index 93fe732d7..e38a0f48f 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -49,20 +49,29 @@ for asm in sorted(os.listdir('test')): cmd += ['--source-map', os.path.join('test', wasm + '.map'), '-o', 'a.wasm'] run_command(cmd) +extension_arg_map = { + '.wast': [], + '.clamp.wast': ['--trap-mode=clamp'], + '.js.wast': ['--trap-mode=js'], +} for dot_s_dir in ['dot_s', 'llvm_autogenerated']: for s in sorted(os.listdir(os.path.join('test', dot_s_dir))): if not s.endswith('.s'): continue print '..', s - wasm = s.replace('.s', '.wast') - full = os.path.join('test', dot_s_dir, s) - stack_alloc = ['--allocate-stack=1024'] if dot_s_dir == 'llvm_autogenerated' else [] - cmd = S2WASM + [full, '--emscripten-glue'] + stack_alloc - if s.startswith('start_'): - cmd.append('--start') - actual = run_command(cmd, stderr=subprocess.PIPE, expected_err='') - - expected_file = os.path.join('test', dot_s_dir, wasm) - with open(expected_file, 'w') as o: o.write(actual) + for ext, ext_args in extension_arg_map.iteritems(): + wasm = s.replace('.s', ext) + expected_file = os.path.join('test', dot_s_dir, wasm) + if ext != '.wast' and not os.path.exists(expected_file): + continue + + full = os.path.join('test', dot_s_dir, s) + stack_alloc = ['--allocate-stack=1024'] if dot_s_dir == 'llvm_autogenerated' else [] + cmd = S2WASM + [full, '--emscripten-glue'] + stack_alloc + ext_args + if s.startswith('start_'): + cmd.append('--start') + actual = run_command(cmd, stderr=subprocess.PIPE, expected_err='') + + with open(expected_file, 'w') as o: o.write(actual) for t in sorted(os.listdir(os.path.join('test', 'print'))): if t.endswith('.wast'): |