summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-03-30 17:46:55 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-03-30 17:46:55 -0700
commit9b79d4ccac0c47e58ce3cfe033730106b6fd302f (patch)
tree10e11f29df2b6ccbf6b24d9d4289b1e32c586093 /check.py
parentcb71620e64a267bb39412b3b578379835feb64b2 (diff)
parent57275446a9cca19ab58bb937753cf75cbd1481fb (diff)
downloadbinaryen-9b79d4ccac0c47e58ce3cfe033730106b6fd302f.tar.gz
binaryen-9b79d4ccac0c47e58ce3cfe033730106b6fd302f.tar.bz2
binaryen-9b79d4ccac0c47e58ce3cfe033730106b6fd302f.zip
Merge pull request #297 from WebAssembly/frist_wasm_backend_full_test
More tests for wasm backend
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/check.py b/check.py
index a1f11acaf..e5f33610e 100755
--- a/check.py
+++ b/check.py
@@ -536,17 +536,19 @@ if has_vanilla_emcc and has_vanilla_llvm:
print '..', c
base = c.replace('.cpp', '').replace('.c', '')
expected = open(os.path.join('test', 'wasm_backend', base + '.txt')).read()
- command = [VANILLA_EMCC, '-o', 'a.wasm.js', '-s', 'BINARYEN=1', os.path.join('test', 'wasm_backend', c), '-O1', '-s', 'ONLY_MY_CODE=1']
- print '....' + ' '.join(command)
- if os.path.exists('a.wasm.js'): os.unlink('a.wasm.js')
- subprocess.check_call(command)
- if has_node:
- print ' (check in node)'
- proc = subprocess.Popen([has_node, 'a.wasm.js'], stdout=subprocess.PIPE)
- out, err = proc.communicate()
- assert proc.returncode == 0
- if out.strip() != expected.strip():
- fail(out, expected)
+ for opts in [[], ['-O1'], ['-O2']]:
+ only = [] if opts != ['-O1'] or 'real' in base else ['-s', 'ONLY_MY_CODE=1'] # only my code is a hack we used early in wasm backend dev, which somehow worked, but only with -O1
+ command = [VANILLA_EMCC, '-o', 'a.wasm.js', os.path.join('test', 'wasm_backend', c)] + opts + only
+ print '....' + ' '.join(command)
+ if os.path.exists('a.wasm.js'): os.unlink('a.wasm.js')
+ subprocess.check_call(command)
+ if has_node:
+ print ' (check in node)'
+ proc = subprocess.Popen([has_node, 'a.wasm.js'], stdout=subprocess.PIPE)
+ out, err = proc.communicate()
+ assert proc.returncode == 0
+ if out.strip() != expected.strip():
+ fail(out, expected)
finally:
if has_vanilla_llvm:
del os.environ['LLVM']