summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-07 21:28:26 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-07 21:28:26 -0700
commitd30b98d47697daa167333db66ac0fe3d8a693eae (patch)
tree75ad13773b0422d8f42b184ab8544d69384ef7da /check.py
parentc0f0be986d9009a05a3bbaf42c841b863d9b83c1 (diff)
parent540056ededd811b859e0cf4db9782d8cb7711215 (diff)
downloadbinaryen-d30b98d47697daa167333db66ac0fe3d8a693eae.tar.gz
binaryen-d30b98d47697daa167333db66ac0fe3d8a693eae.tar.bz2
binaryen-d30b98d47697daa167333db66ac0fe3d8a693eae.zip
Merge pull request #319 from WebAssembly/traversal
Refactor traversal into its own header
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/check.py b/check.py
index f97ca0941..03e3a919a 100755
--- a/check.py
+++ b/check.py
@@ -262,6 +262,19 @@ for e in executables:
assert e in err, 'Expected help to contain program name, got:\n%s' % err
assert len(err.split('\n')) > 8, 'Expected some help, got:\n%s' % err
+print '\n[ checking binaryen-shell passes... ]\n'
+
+for t in sorted(os.listdir(os.path.join('test', 'passes'))):
+ if t.endswith('.wast'):
+ print '..', t
+ passname = os.path.basename(t).replace('.wast', '')
+ opt = '-O' if passname == 'O' else '--' + passname
+ cmd = [os.path.join('bin', 'binaryen-shell'), opt, os.path.join('test', 'passes', t), '--print']
+ print ' ', ' '.join(cmd)
+ actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+ assert not err, err
+ fail_if_not_identical(actual, open(os.path.join('test', 'passes', passname + '.txt')).read())
+
print '[ checking asm2wasm testcases... ]\n'
for asm in tests:
@@ -325,19 +338,6 @@ for t in sorted(os.listdir(os.path.join('test', 'print'))):
actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
fail_if_not_identical(actual.strip(), open(os.path.join('test', 'print', wasm + '.minified.txt')).read().strip())
-print '\n[ checking binaryen-shell passes... ]\n'
-
-for t in sorted(os.listdir(os.path.join('test', 'passes'))):
- if t.endswith('.wast'):
- print '..', t
- passname = os.path.basename(t).replace('.wast', '')
- opt = '-O' if passname == 'O' else '--' + passname
- cmd = [os.path.join('bin', 'binaryen-shell'), opt, os.path.join('test', 'passes', t), '--print']
- print ' ', ' '.join(cmd)
- actual, err = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
- assert not err, err
- fail_if_not_identical(actual, open(os.path.join('test', 'passes', passname + '.txt')).read())
-
print '\n[ checking binaryen-shell testcases... ]\n'
for t in tests: