mirror of
https://github.com/libretro/blastem.git
synced 2026-11-07 10:15:58 -10:00
This repo has been sitting on the July 2022 state of upstream BlastEm. The sync brings in four years of upstream work, most importantly for this repo the DSL generated CPU cores: upstream's Makefile now switches to NEW_CORE automatically on any architecture that has no native code generator, and genesis.h picks up the generated m68k context in that configuration, which is what makes non-x86 builds possible at all. Only .gitlab-ci.yml and Makefile.libretro are kept from this repo, every other file is upstream's.
76 lines
1.9 KiB
Python
Executable File
76 lines
1.9 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
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]).decode()
|
|
try:
|
|
m = subprocess.check_output(['../blastem_clean/ztestrun', path]).decode()
|
|
#_,_,b = b.partition('\n')
|
|
m = m.split('\n')
|
|
b = b.split('\n')
|
|
if b != m:
|
|
lastWasFlags = False
|
|
bdiff = []
|
|
mdiff = []
|
|
for i in range(0, max(len(b), len(m))):
|
|
bl = b[i] if i < len(b) else ''
|
|
ml = m[i] if i < len(m) else ''
|
|
if bl != ml:
|
|
if lastWasFlags:
|
|
bdiff.append(b[i - 1])
|
|
mdiff.append(m[i - 1])
|
|
bdiff.append(bl)
|
|
mdiff.append(ml)
|
|
lastWasFlags = bl.startswith('Flags: ')
|
|
print('-----------------------------')
|
|
print('Mismatch in ' + path)
|
|
print('blastem output:')
|
|
for b in bdiff:
|
|
print(b)
|
|
print('clean output:')
|
|
for m in mdiff:
|
|
print(m)
|
|
print('-----------------------------')
|
|
else:
|
|
print(path, 'passed')
|
|
except subprocess.CalledProcessError as e:
|
|
print('-----------------------------')
|
|
print('clean 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('-----------------------------')
|
|
|