d/log-reftests.py: Log uuencoded variant GSK reftest renderings too
authorSimon McVittie <smcv@debian.org>
Mon, 4 Sep 2023 09:28:58 +0000 (10:28 +0100)
committerSimon McVittie <smcv@debian.org>
Mon, 4 Sep 2023 14:28:17 +0000 (15:28 +0100)
The variant GSK reftest renderings (flipped, repeated, etc.) might fail
differently, in which case we will want to look at their outputs.

debian/log-reftests.py

index eefb1cbdfbfcf60c8b4201c0864c5d5e0116b28b..382f495c346f7006903e6e4efd8db0cc38396334 100755 (executable)
@@ -18,22 +18,29 @@ if __name__ == '__main__':
                 'gl', 'x11',
             ),
         ):
-            diff = (outputs / (node.stem + '.diff.png'))
+            for tail in ('', '-flipped', '-repeated', '-rotated', '-masked'):
+                diff = (outputs / (node.stem + tail + '.diff.png'))
 
-            if diff.exists():
-                ref = Path('testsuite', 'gsk', 'compare', node.stem + '.png')
-                out = (outputs / (node.stem + '.out.png'))
+                if diff.exists():
+                    if tail:
+                        ref = outputs / (node.stem + tail + '.ref.png')
+                    else:
+                        ref = Path(
+                            'testsuite', 'gsk', 'compare', node.stem + '.png',
+                        )
 
-                for path in (ref, out, diff):
-                    if path.exists():
-                        print('begin-base64 644 %s' % path)
-                        sys.stdout.flush()
-                        with open(path, 'rb') as reader:
-                            base64.encode(reader, sys.stdout.buffer)
-                        print('====')
-                        print('')
+                    out = (outputs / (node.stem + tail + '.out.png'))
 
-                print('')
+                    for path in (ref, out, diff):
+                        if path.exists():
+                            print('begin-base64 644 %s' % path)
+                            sys.stdout.flush()
+                            with open(path, 'rb') as reader:
+                                base64.encode(reader, sys.stdout.buffer)
+                            print('====')
+                            print('')
+
+                    print('')
 
     for ui in Path('testsuite', 'reftests').glob('*.ui'):
         for outputs in (