summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py64
1 files changed, 1 insertions, 63 deletions
diff --git a/check.py b/check.py
index 588f99737..490c70be9 100755
--- a/check.py
+++ b/check.py
@@ -21,7 +21,7 @@ import sys
from scripts.test.support import run_command, split_wast, node_test_glue, node_has_webassembly
from scripts.test.shared import (
- BIN_DIR, EMCC, MOZJS, NATIVECC, NATIVEXX, NODEJS, BINARYEN_JS,
+ BIN_DIR, MOZJS, NATIVECC, NATIVEXX, NODEJS, BINARYEN_JS,
WASM_AS, WASM_CTOR_EVAL, WASM_OPT, WASM_SHELL, WASM_MERGE, WASM_METADCE,
WASM_DIS, WASM_REDUCE, binary_format_check, delete_from_orbit, fail, fail_with_error,
fail_if_not_identical, fail_if_not_contained, has_vanilla_emcc,
@@ -586,66 +586,6 @@ def run_gcc_tests():
fail_if_not_identical_to_file(actual, expected)
-def run_emscripten_tests():
- if not os.path.exists(os.path.join(options.binaryen_bin, 'wasm.js')):
- print 'no wasm.js build to test'
- return
-
- print '\n[ checking wasm.js methods... ]\n'
-
- for method_init in ['interpret-asm2wasm', 'interpret-s-expr', 'asmjs', 'interpret-binary', 'asmjs,interpret-binary', 'interpret-binary,asmjs']:
- # check success and failure for simple modes, only success for combined/fallback ones
- for success in [1, 0] if ',' not in method_init else [1]:
- method = method_init
- command = [EMCC, '-o', 'a.wasm.js', '-s', 'BINARYEN=1', os.path.join(options.binaryen_test, 'hello_world.c')]
- command += ['-s', 'BINARYEN_METHOD="' + method + '"']
- print method, ' : ', ' '.join(command), ' => ', success
- subprocess.check_call(command)
-
- see_polyfill = 'var WasmJS = ' in open('a.wasm.js').read()
-
- if method and 'interpret' 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);')
- asm = asm.replace("'almost asm'", '"use asm"; var not_in_asm = [].length + (true || { x: 5 }.x);')
- with open('a.wasm.asm.js', 'w') as o:
- o.write(asm)
- if method.startswith('interpret-asm2wasm'):
- delete_from_orbit('a.wasm.wast') # we should not need the .wast
- if not success:
- break_cashew() # we need cashew
- elif method.startswith('interpret-s-expr'):
- delete_from_orbit('a.wasm.asm.js') # we should not need the .asm.js
- if not success:
- delete_from_orbit('a.wasm.wast')
- elif method.startswith('asmjs'):
- delete_from_orbit('a.wasm.wast') # we should not need the .wast
- break_cashew() # we don't use cashew, so ok to break it
- if not success:
- delete_from_orbit('a.wasm.js')
- elif method.startswith('interpret-binary'):
- delete_from_orbit('a.wasm.wast') # we should not need the .wast
- delete_from_orbit('a.wasm.asm.js') # we should not need the .asm.js
- if not success:
- delete_from_orbit('a.wasm.wasm')
- else:
- 1 / 0
- if NODEJS:
- proc = subprocess.Popen([NODEJS, 'a.wasm.js'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- out, err = proc.communicate()
- if success:
- assert proc.returncode == 0, err
- assert 'hello, world!' in out, out
- else:
- assert proc.returncode != 0, err
- assert 'hello, world!' not in out, out
-
-
# Run all the tests
def main():
run_help_tests()
@@ -671,8 +611,6 @@ def main():
print '\n[ checking example testcases... ]\n'
if options.run_gcc_tests:
run_gcc_tests()
- if EMCC:
- run_emscripten_tests()
# Check/display the results
if num_failures == 0: