summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-xauto_update_tests.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 376500e48..7e07af3a5 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -4,7 +4,7 @@ import os, sys, subprocess, difflib
from scripts.test.support import run_command, split_wast
from scripts.test.shared import (
- ASM2WASM, S2WASM, WASM_SHELL, WASM_OPT, WASM_AS, WASM_DIS, WASM_CTOR_EVAL)
+ ASM2WASM, MOZJS, S2WASM, WASM_SHELL, WASM_OPT, WASM_AS, WASM_DIS, WASM_CTOR_EVAL)
print '[ processing and updating testcases... ]\n'
@@ -199,6 +199,7 @@ for t in os.listdir('test'):
print '..', t
t = os.path.join('test', t)
cmd = WASM_DIS + [t]
+ if os.path.isfile(t + '.map'): cmd += ['--source-map', t + '.map']
actual = run_command(cmd)
open(t + '.fromBinary', 'w').write(actual)
@@ -223,18 +224,19 @@ for t in os.listdir(os.path.join('test', 'merge')):
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'))):
- if not s.endswith('.js'): continue
- print s
- f = open('a.js', 'w')
- f.write(open(os.path.join('bin', 'binaryen.js')).read())
- f.write(open(os.path.join('test', 'binaryen.js', s)).read())
- f.close()
- cmd = ['mozjs', 'a.js']
- out = run_command(cmd, stderr=subprocess.STDOUT)
- open(os.path.join('test', 'binaryen.js', s + '.txt'), 'w').write(out)
+if MOZJS:
+ print '\n[ checking binaryen.js testcases... ]\n'
+
+ for s in sorted(os.listdir(os.path.join('test', 'binaryen.js'))):
+ if not s.endswith('.js'): continue
+ print s
+ f = open('a.js', 'w')
+ f.write(open(os.path.join('bin', 'binaryen.js')).read())
+ f.write(open(os.path.join('test', 'binaryen.js', s)).read())
+ f.close()
+ cmd = [MOZJS, 'a.js']
+ out = run_command(cmd, stderr=subprocess.STDOUT)
+ with open(os.path.join('test', 'binaryen.js', s + '.txt'), 'w') as o: o.write(out)
print '\n[ checking wasm-ctor-eval... ]\n'