comparison comparetests.py @ 220:cb72780e17b1

Add support for picking random numbers in a larger range in test generator. Add support for running a subset of tests in runner. Added testcases for bit and rotate instructions.
author Mike Pavone <pavone@retrodev.com>
date Sat, 20 Apr 2013 15:14:47 -0700
parents acd29e2664c6
children f7ff02eeec2f
comparison
equal deleted inserted replaced
219:8d3c16071559 220:cb72780e17b1
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 from glob import glob 2 from glob import glob
3 import subprocess 3 import subprocess
4 from sys import exit 4 from sys import exit,argv
5
6 prefixes = []
7 for i in range(1, len(argv)):
8 prefixes.append(argv[i])
5 9
6 for path in glob('generated_tests/*.bin'): 10 for path in glob('generated_tests/*.bin'):
11 if prefixes:
12 good = False
13 for prefix in prefixes:
14 if path.startswith(prefix):
15 good = True
16 break
17 if not good:
18 continue
7 try: 19 try:
8 b = subprocess.check_output(['./blastem', path, '-v']) 20 b = subprocess.check_output(['./blastem', path, '-v'])
9 try: 21 try:
10 m = subprocess.check_output(['musashi/mustrans', path]) 22 m = subprocess.check_output(['musashi/mustrans', path])
11 #_,_,b = b.partition('\n') 23 #_,_,b = b.partition('\n')