From 391d5cebaa5ad227a6e97f821bedee1dbf92b59a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 4 Apr 2016 21:44:06 -0700 Subject: add testing for binaryen.js --- check.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'check.py') diff --git a/check.py b/check.py index e5f33610e..51da15012 100755 --- a/check.py +++ b/check.py @@ -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']: -- cgit v1.2.3