From 8d3250667f7c9b1a06e2fc0d17fe3288d8ea1760 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 11 Jan 2023 18:22:23 +1000 Subject: [PATCH] Scripts: Show first 3 diff frames in regression test --- scripts/check_regression_tests.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/check_regression_tests.py b/scripts/check_regression_tests.py index cd01b575c..725ec7746 100644 --- a/scripts/check_regression_tests.py +++ b/scripts/check_regression_tests.py @@ -48,6 +48,8 @@ def check_regression_test(baselinedir, testdir, name): #print("*** %s is missing in test set" % name) return False + num_diff = 0 + header_written = False images = glob.glob(os.path.join(dir1, "frame_*.png")) for imagepath in images: imagename = Path(imagepath).name @@ -61,21 +63,27 @@ def check_regression_test(baselinedir, testdir, name): path2 = os.path.join(dir2, imagename) if not os.path.isfile(path2): print("--- Frame %u for %s is missing in test set" % (framenum, name)) - write("

{}

".format(name)) - write("--- Frame %u for %s is missing in test set" % (framenum, name)) - return False + if not header_written: + write("

{}

".format(name)) + header_written = True + write("

--- Frame %u for %s is missing in test set

" % (framenum, name)) + continue if not compare_frames(path1, path2): print("*** Difference in frame %u for %s" % (framenum, name)) imguri1 = Path(path1).as_uri() imguri2 = Path(path2).as_uri() - write("

{}

".format(name)) + if not header_written: + write("

{}

".format(name)) + header_written = True write("") write("".format(framenum)) write("".format(imguri1, imguri2)) write("
Frame {}
") - return False + num_diff += 1 + if (num_diff >= 3): + return False return True