summaryrefslogtreecommitdiff
path: root/comparetests.py
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-04-19 09:29:37 -0700
committerMike Pavone <pavone@retrodev.com>2013-04-19 09:29:37 -0700
commit1a6e3d076d0f73ad1ab1cc5b808a772d371021df (patch)
tree37ef9d213dd363673dc8d5dbe1ae0acd082ee848 /comparetests.py
parent9d263ae4d5ae12022177b4dda9120c88b20604df (diff)
Add test generator, builder and runner
Diffstat (limited to 'comparetests.py')
-rwxr-xr-xcomparetests.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/comparetests.py b/comparetests.py
new file mode 100755
index 0000000..40647c5
--- /dev/null
+++ b/comparetests.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+from glob import glob
+import subprocess
+from sys import exit
+
+for path in glob('generated_tests/*.bin'):
+ try:
+ b = subprocess.check_output(['./blastem', path])
+ try:
+ m = subprocess.check_output(['musashi/mustrans', path])
+ _,_,b = b.partition('\n')
+ if b != m:
+ print '-----------------------------'
+ print 'Mismatch in ' + path
+ print 'blastem output:'
+ print b
+ print 'musashi output:'
+ print m
+ print '-----------------------------'
+ else:
+ print path, 'passed'
+ except subprocess.CalledProcessError as e:
+ print '-----------------------------'
+ print 'musashi exited with code', e.returncode, 'for test', path
+ print 'blastem output:'
+ print b
+ print '-----------------------------'
+ except subprocess.CalledProcessError as e:
+ print '-----------------------------'
+ print 'blastem exited with code', e.returncode, 'for test', path
+ print '-----------------------------'
+