diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-03-11 17:47:10 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-03-11 17:47:10 -0800 |
commit | b8b54704bf510ad49e6897b9903d74a9553fd9d1 (patch) | |
tree | c09cf841ad7d749377785f614684bdca2b1c8905 /check.py | |
parent | eb1e5b6cc7f32b704bb14b147f47ee7919241503 (diff) | |
parent | 6fc08966aeaace7db8220e8ba9c3f85297564abb (diff) | |
download | binaryen-b8b54704bf510ad49e6897b9903d74a9553fd9d1.tar.gz binaryen-b8b54704bf510ad49e6897b9903d74a9553fd9d1.tar.bz2 binaryen-b8b54704bf510ad49e6897b9903d74a9553fd9d1.zip |
Merge pull request #242 from WebAssembly/methods
Support a comma-separated list of methods in wasm/js integration
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -568,8 +568,9 @@ if has_emcc: print '\n[ checking wasm.js methods... ]\n' - for method in [None, 'asm2wasm', 'wasm-s-parser', 'just-asm']: + for method_init in [None, 'asm2wasm', 'wasm-s-parser', 'just-asm']: for success in [1, 0]: + method = method_init command = ['emcc', '-o', 'a.wasm.js', '-s', 'BINARYEN=1', os.path.join('test', 'hello_world.c') ] if method: command += ['-s', 'BINARYEN_METHOD="' + method + '"'] @@ -577,6 +578,13 @@ if has_emcc: method = 'wasm-s-parser' # this is the default print method, ' : ', ' '.join(command), ' => ', success subprocess.check_call(command) + + see_polyfill = 'var WasmJS = ' in open('a.wasm.js').read() + if method and 'asm2wasm' not in method and 'wasm-s-parser' not in method: + assert not see_polyfill, 'verify polyfill was not added - we specified a method, and it does not need it' + else: + assert see_polyfill, 'we need the polyfill' + def break_cashew(): asm = open('a.wasm.asm.js').read() asm = asm.replace('"almost asm"', '"use asm"; var not_in_asm = [].length + (true || { x: 5 }.x);') |