summaryrefslogtreecommitdiff
path: root/zcompare.py
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2015-05-28 21:19:55 -0700
committerMichael Pavone <pavone@retrodev.com>2015-05-28 21:19:55 -0700
commitef033e39c170fe272a956b1417f217a0d3cce29c (patch)
tree0ca08ba1614e87cee73f4904ea362928565b2531 /zcompare.py
parent632c82bd63a13da242c90a5d93dfe7482a0bebe6 (diff)
parent6817ef558d165b50a9b08a337dd93c4f1f46304e (diff)
Merge windows branch with latest changes
Diffstat (limited to 'zcompare.py')
-rwxr-xr-xzcompare.py58
1 files changed, 58 insertions, 0 deletions
diff --git a/zcompare.py b/zcompare.py
new file mode 100755
index 0000000..d6eacea
--- /dev/null
+++ b/zcompare.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+from glob import glob
+import subprocess
+from sys import exit,argv
+
+prefixes = []
+skip = set()
+for i in range(1, len(argv)):
+ if '.' in argv[i]:
+ f = open(argv[i])
+ for line in f:
+ parts = line.split()
+ for part in parts:
+ if part.endswith('.bin'):
+ skip.add(part)
+ f.close()
+ print 'Skipping',len(skip),'entries from previous report.'
+ else:
+ prefixes.append(argv[i])
+
+for path in glob('ztests/*/*.bin'):
+ if path in skip:
+ continue
+ if prefixes:
+ good = False
+ fname = path.split('/')[-1]
+ for prefix in prefixes:
+ if fname.startswith(prefix):
+ good = True
+ break
+ if not good:
+ continue
+ try:
+ b = subprocess.check_output(['./ztestrun', path])
+ try:
+ m = subprocess.check_output(['gxz80/gxzrun', path])
+ #_,_,b = b.partition('\n')
+ if b != m:
+ print '-----------------------------'
+ print 'Mismatch in ' + path
+ print 'blastem output:'
+ print b
+ print 'gxz80 output:'
+ print m
+ print '-----------------------------'
+ else:
+ print path, 'passed'
+ except subprocess.CalledProcessError as e:
+ print '-----------------------------'
+ print 'gxz80 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 '-----------------------------'
+