From ea3a2f2c276c76ff27665e168877ebb771fa12b4 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 11 Mar 2016 14:42:25 -0800 Subject: update emscripten and add testing for not including wasm.js polyfill unnecessarily --- check.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'check.py') diff --git a/check.py b/check.py index 272e1394c..08c6f5887 100755 --- a/check.py +++ b/check.py @@ -577,6 +577,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);') -- cgit v1.2.3 From 6fc08966aeaace7db8220e8ba9c3f85297564abb Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 11 Mar 2016 14:52:45 -0800 Subject: fix test harness assignment --- check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index 08c6f5887..744042393 100755 --- a/check.py +++ b/check.py @@ -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 + '"'] -- cgit v1.2.3