diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-12-07 15:28:00 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-12-07 15:29:30 -0800 |
commit | f9782b01cd76e76d5921a7e526e2e4577dbf29e4 (patch) | |
tree | 1f9afee63cd06a3848605cd769b35d4caedc53eb | |
parent | 567ac5040752e1e06910f97fe181b95f19e0613d (diff) | |
download | binaryen-f9782b01cd76e76d5921a7e526e2e4577dbf29e4.tar.gz binaryen-f9782b01cd76e76d5921a7e526e2e4577dbf29e4.tar.bz2 binaryen-f9782b01cd76e76d5921a7e526e2e4577dbf29e4.zip |
check asm.js validation in wasm2asm output
-rwxr-xr-x | check.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -127,14 +127,23 @@ for wasm in ['min.wast', 'hello_world.wast', 'unit.wast', 'emcc_O2_hello_world.w if actual != expected: fail(actual, expected) + open('a.2asm.js', 'w').write(actual) + if has_node: # 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] + if has_mozjs: + # verify asm.js validates + open('a.2asm.js', 'w').write(actual) + proc = subprocess.Popen(['mozjs', '-w', 'a.2asm.js'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = proc.communicate() + assert proc.returncode == 0 + fail_if_not_contained(err, 'Successfully compiled asm.js code') + print '\n[ checking binaryen-shell... ]\n' actual, err = subprocess.Popen([os.path.join('bin', 'binaryen-shell'), '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() |