diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-04-04 21:44:06 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-04-04 21:49:41 -0700 |
commit | 391d5cebaa5ad227a6e97f821bedee1dbf92b59a (patch) | |
tree | 2c09e3e187d4410c35a6c8b5f2f7f94cc72e853c /check.py | |
parent | 55d0683bfe07485c4b53cad0433da3f0e91bddd3 (diff) | |
download | binaryen-391d5cebaa5ad227a6e97f821bedee1dbf92b59a.tar.gz binaryen-391d5cebaa5ad227a6e97f821bedee1dbf92b59a.tar.bz2 binaryen-391d5cebaa5ad227a6e97f821bedee1dbf92b59a.zip |
add testing for binaryen.js
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -450,6 +450,23 @@ for wasm in tests + [os.path.join('spec', name) for name in ['address.wast']]:#s fail_if_not_contained(err, 'Successfully compiled asm.js code') ''' +if has_node: + print '\n[ checking binaryen.js testcases... ]\n' + + for s in sorted(os.listdir(os.path.join('test', 'binaryen.js'))): + if not s.endswith('.js'): continue + print s + f = open('a.js', 'w') + f.write(open(os.path.join('bin', 'binaryen.js')).read()) + f.write(open(os.path.join('test', 'binaryen.js', s)).read()) + f.close() + proc = subprocess.Popen([has_node, 'a.js'], stdout=subprocess.PIPE) + out, err = proc.communicate() + assert proc.returncode == 0 + expected = open(os.path.join('test', 'binaryen.js', s + '.txt')).read() + if expected not in out: + fail(out, expected) + print '\n[ checking .s testcases... ]\n' for dot_s_dir in ['dot_s', 'llvm_autogenerated']: |