Mercurial > repos > blastem
view comparetests.py @ 233:9d10669f2579
Less broken implementation of shadow/highlight
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 22 Apr 2013 23:34:39 -0700 |
parents | f7ff02eeec2f |
children | 306986209cba |
line wrap: on
line source
#!/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('generated_tests/*/*.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(['./blastem', path, '-v']) 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 '-----------------------------'