summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2017-04-17 13:26:33 -0700
committerGitHub <noreply@github.com>2017-04-17 13:26:33 -0700
commit2e210c1fca804a4ec86bef8855f819747d8bd7ca (patch)
tree9a90eaee299773f1a0dc1412a5c636c3bc31cf4e /auto_update_tests.py
parentec66e273e350c3d48df0ccaaf73c53b14485848f (diff)
downloadbinaryen-2e210c1fca804a4ec86bef8855f819747d8bd7ca.tar.gz
binaryen-2e210c1fca804a4ec86bef8855f819747d8bd7ca.tar.bz2
binaryen-2e210c1fca804a4ec86bef8855f819747d8bd7ca.zip
wasm-merge tool (#919)
wasm-merge tool: combines two wasm files into a larger one, handling collisions, and aware of the dynamic linking conventions. it does not do full static linking, but may eventually.
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-xauto_update_tests.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 9f569d14d..76cd02cbb 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -193,6 +193,26 @@ for t in os.listdir('test'):
open(t + '.fromBinary', 'w').write(actual)
+print '\n[ checking wasm-merge... ]\n'
+
+for t in os.listdir(os.path.join('test', 'merge')):
+ if t.endswith(('.wast', '.wasm')):
+ print '..', t
+ t = os.path.join('test', 'merge', t)
+ u = t + '.toMerge'
+ for finalize in [0, 1]:
+ for opt in [0, 1]:
+ cmd = [os.path.join('bin', 'wasm-merge'), t, u, '-o', 'a.wast', '-S', '--verbose']
+ if finalize: cmd += ['--finalize-memory-base=1024', '--finalize-table-base=8']
+ if opt: cmd += ['-O']
+ stdout = run_command(cmd)
+ actual = open('a.wast').read()
+ out = t + '.combined'
+ if finalize: out += '.finalized'
+ if opt: out += '.opt'
+ with open(out, 'w') as o: o.write(actual)
+ with open(out + '.stdout', 'w') as o: o.write(stdout)
+
print '\n[ checking binaryen.js testcases... ]\n'
for s in sorted(os.listdir(os.path.join('test', 'binaryen.js'))):