comparison comparetests.py @ 214:9126c33cc33c

Add test generator, builder and runner
author Mike Pavone <pavone@retrodev.com>
date Fri, 19 Apr 2013 09:29:37 -0700
parents
children acd29e2664c6
comparison
equal deleted inserted replaced
213:4d4559b04c59 214:9126c33cc33c
1 #!/usr/bin/env python
2 from glob import glob
3 import subprocess
4 from sys import exit
5
6 for path in glob('generated_tests/*.bin'):
7 try:
8 b = subprocess.check_output(['./blastem', path])
9 try:
10 m = subprocess.check_output(['musashi/mustrans', path])
11 _,_,b = b.partition('\n')
12 if b != m:
13 print '-----------------------------'
14 print 'Mismatch in ' + path
15 print 'blastem output:'
16 print b
17 print 'musashi output:'
18 print m
19 print '-----------------------------'
20 else:
21 print path, 'passed'
22 except subprocess.CalledProcessError as e:
23 print '-----------------------------'
24 print 'musashi exited with code', e.returncode, 'for test', path
25 print 'blastem output:'
26 print b
27 print '-----------------------------'
28 except subprocess.CalledProcessError as e:
29 print '-----------------------------'
30 print 'blastem exited with code', e.returncode, 'for test', path
31 print '-----------------------------'
32