mirror of
https://github.com/stenzek/duckstation.git
synced 2024-11-26 23:50:31 +00:00
RegTest: Improve -maxframes option
Grab the last N frames instead of first N. Better for showing crashes.
This commit is contained in:
parent
5caadec34d
commit
596cca9be2
@ -310,8 +310,9 @@ def check_regression_test(baselinedir, testdir, name):
|
||||
|
||||
has_any = True
|
||||
if not compare_frames(path1, path2):
|
||||
diff_frames.append(framenum)
|
||||
diff_frames.append((framenum, path1, path2))
|
||||
|
||||
for (framenum, path1, path2) in diff_frames[-MAX_DIFF_FRAMES:]:
|
||||
if first_fail:
|
||||
write("<div class=\"item\">")
|
||||
write("<h1>{}</h1>".format(name))
|
||||
@ -323,14 +324,11 @@ def check_regression_test(baselinedir, testdir, name):
|
||||
write("<tr><td colspan=\"2\">Frame %d</td></tr>" % (framenum))
|
||||
write("<tr><td><img class=\"before\" src=\"%s\" /></td><td><img class=\"after\" src=\"%s\" /></td></tr>" % (imguri1, imguri2))
|
||||
|
||||
if len(diff_frames) == MAX_DIFF_FRAMES:
|
||||
break
|
||||
|
||||
if not first_fail:
|
||||
write("</table>")
|
||||
write("<pre>Difference in frames [%s] for %s</pre>" % (",".join(map(str, diff_frames)), name))
|
||||
write("<pre>Difference in frames [%s] for %s</pre>" % (",".join(map(lambda x: str(x[0]), diff_frames)), name))
|
||||
write("</div>")
|
||||
print("*** Difference in frames [%s] for %s" % (",".join(map(str, diff_frames)), name))
|
||||
print("*** Difference in frames [%s] for %s" % (",".join(map(lambda x: str(x[0]), diff_frames)), name))
|
||||
#assert has_any
|
||||
|
||||
return len(diff_frames) == 0
|
||||
|
@ -55,8 +55,6 @@ def run_regression_tests(runner, gamedir, destdir, dump_interval, frames, parall
|
||||
for filename in pool.imap_unordered(func, gamepaths, chunksize=1):
|
||||
completed += 1
|
||||
print("[%u%% %u/%u] %s" % ((completed * 100) // len(gamepaths), completed, len(gamepaths), filename))
|
||||
|
||||
pool.map(func, gamepaths, chunksize=1)
|
||||
pool.close()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user