summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-04 21:44:06 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-04 21:49:41 -0700
commit391d5cebaa5ad227a6e97f821bedee1dbf92b59a (patch)
tree2c09e3e187d4410c35a6c8b5f2f7f94cc72e853c /check.py
parent55d0683bfe07485c4b53cad0433da3f0e91bddd3 (diff)
downloadbinaryen-391d5cebaa5ad227a6e97f821bedee1dbf92b59a.tar.gz
binaryen-391d5cebaa5ad227a6e97f821bedee1dbf92b59a.tar.bz2
binaryen-391d5cebaa5ad227a6e97f821bedee1dbf92b59a.zip
add testing for binaryen.js
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py17
1 files changed, 17 insertions, 0 deletions
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']: