summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@users.noreply.github.com>2018-02-12 13:43:25 -0800
committerGitHub <noreply@github.com>2018-02-12 13:43:25 -0800
commit8ddbac2c642e9fe0809afadbc28abe7c5f668674 (patch)
tree705f242904654903d7d17b5ecb612042862ed6e8 /auto_update_tests.py
parent1f8fd302b35d4e192901b3f0b1eb915aabb3ae03 (diff)
downloadbinaryen-8ddbac2c642e9fe0809afadbc28abe7c5f668674.tar.gz
binaryen-8ddbac2c642e9fe0809afadbc28abe7c5f668674.tar.bz2
binaryen-8ddbac2c642e9fe0809afadbc28abe7c5f668674.zip
Support multiple extensions in lld test generation (#1417)
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-xauto_update_tests.py31
1 files changed, 22 insertions, 9 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 1ec8f23c5..8e75ffb6b 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -76,22 +76,35 @@ for dot_s_dir in ['dot_s', 'llvm_autogenerated']:
print '\n[ checking wasm-link-metadata testcases... ]\n'
+link_metadata_extension_arg_map = {
+ '.json': [],
+ '.jscall.json': ['--emscripten-reserved-function-pointers=3'],
+}
for obj_path in files_with_pattern('test', 'lld', '*.o'):
print '..', obj_path
- json_path = obj_path.replace('.o', '.json')
-
- cmd = WASM_LINK_METADATA + [obj_path]
- actual = run_command(cmd)
- with open(json_path, 'w') as o: o.write(actual)
+ for ext, ext_args in link_metadata_extension_arg_map.items():
+ json_path = obj_path.replace('.o', ext)
+ if ext != 'json' and not os.path.exists(json_path):
+ continue
+ cmd = WASM_LINK_METADATA + [obj_path] + ext_args
+ actual = run_command(cmd)
+ with open(json_path, 'w') as o: o.write(actual)
print '\n[ checking wasm-emscripten-finalize testcases... ]\n'
+emscripten_finalize_extension_arg_map = {
+ '.out': [],
+ '.jscall.out': ['--emscripten-reserved-function-pointers=3'],
+}
for wast_path in files_with_pattern('test', 'lld', '*.wast'):
print '..', wast_path
- out_path = wast_path + '.out'
- cmd = WASM_EMSCRIPTEN_FINALIZE + [wast_path, '-S']
- actual = run_command(cmd)
- with open(out_path, 'w') as o: o.write(actual)
+ for ext, ext_args in emscripten_finalize_extension_arg_map.items():
+ out_path = wast_path + ext
+ if ext != '.out' and not os.path.exists(out_path):
+ continue
+ cmd = WASM_EMSCRIPTEN_FINALIZE + [wast_path, '-S'] + ext_args
+ actual = run_command(cmd)
+ with open(out_path, 'w') as o: o.write(actual)
for t in sorted(os.listdir(os.path.join('test', 'print'))):
if t.endswith('.wast'):