summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/check.py b/check.py
index 21e0267f7..a5d05a2c0 100755
--- a/check.py
+++ b/check.py
@@ -74,7 +74,7 @@ for asm in tests:
raise Exception('wasm interpreter error: ' + err) # failed to pretty-print
raise Exception('wasm interpreter error')
-print '\n[ checking wasm2asm testcases... ]\n'
+print '\n[ checking wasm2asm testcases... (need nodejs in your path) ]\n'
for wasm in ['min.wast', 'hello_world.wast', 'unit.wast', 'emcc_O2_hello_world.wast']:
if wasm.endswith('.wast'):
@@ -92,6 +92,13 @@ for wasm in ['min.wast', 'hello_world.wast', 'unit.wast', 'emcc_O2_hello_world.w
if actual != expected:
fail(actual, expected)
+ # verify asm.js is valid js
+ open('a.2asm.js', 'w').write(actual)
+ proc = subprocess.Popen(['nodejs', 'a.2asm.js'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ out, err = proc.communicate()
+ assert proc.returncode == 0
+ assert not out and not err, [out, err]
+
print '\n[ checking binaryen-shell... ]\n'
actual, err = subprocess.Popen([os.path.join('bin', 'binaryen-shell'), '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()