summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2015-11-22 14:37:21 -0800
committerAlon Zakai <alonzakai@gmail.com>2015-11-22 14:37:21 -0800
commit860e52c64da5200676d4226a2e48c849945f6687 (patch)
treea733b4f4d94384298599233d1b2ad4ef3ad2ac8d /check.py
parentac1d0f855f3fde65753aeea546c6781dbfd331ba (diff)
downloadbinaryen-860e52c64da5200676d4226a2e48c849945f6687.tar.gz
binaryen-860e52c64da5200676d4226a2e48c849945f6687.tar.bz2
binaryen-860e52c64da5200676d4226a2e48c849945f6687.zip
refactor pass tests
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/check.py b/check.py
index 7f0ebd5f5..88ade596d 100755
--- a/check.py
+++ b/check.py
@@ -80,9 +80,14 @@ fail_if_not_contained(actual, 'options:')
fail_if_not_contained(actual, 'passes:')
fail_if_not_contained(actual, ' -lower-if-else')
-print ' ', ' '.join([os.path.join('bin', 'binaryen-shell'), '-print-before', '-print-after', '-lower-if-else', os.path.join('test', 'if_else.wast')])
-actual, err = subprocess.Popen([os.path.join('bin', 'binaryen-shell'), '-print-before', '-print-after', '-lower-if-else', os.path.join('test', 'if_else.wast')], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
-fail_if_not_identical(actual, open(os.path.join('test', 'if_else.txt')).read())
+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', '')
+ actual, err = subprocess.Popen([os.path.join('bin', 'binaryen-shell'), '-print-before', '-print-after', '-' + passname, os.path.join('test', 'passes', t)], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
+ fail_if_not_identical(actual, open(os.path.join('test', 'passes', passname + '.txt')).read())
print '\n[ checking binaryen-shell testcases... ]\n'