summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Gravelle <jgravelle@google.com>2017-10-17 14:51:51 -0700
committerGitHub <noreply@github.com>2017-10-17 14:51:51 -0700
commitb66518f2300ed1a9c28f983cbbfb377dcb8502a8 (patch)
treeaa091ab346d85dec20605a3e3272d10eac5dfa90
parentdfe92af3e85a7d0e558ffbfaa387ac9f9cf0e8ec (diff)
downloadbinaryen-b66518f2300ed1a9c28f983cbbfb377dcb8502a8.tar.gz
binaryen-b66518f2300ed1a9c28f983cbbfb377dcb8502a8.tar.bz2
binaryen-b66518f2300ed1a9c28f983cbbfb377dcb8502a8.zip
Update auto_update_tests.py for trap-mode flags (#1225)
-rwxr-xr-xauto_update_tests.py29
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'):