Backport reftest comparison machinery from our gtk4 packaging

This will let us distinguish between "fails by small differences caused
by rounding/i387" and "completely different result", without having to
move the whole build system to Meson, which seems like one variation too
many during a transition.
This commit is contained in:
Simon McVittie
2022-08-21 10:21:10 +01:00
parent 728dc88201
commit 375b472689
10 changed files with 390 additions and 67 deletions

33
debian/log-reftests.py vendored Executable file
View File

@ -0,0 +1,33 @@
#!/usr/bin/python3
# Copyright 2021 Simon McVittie
# SPDX-License-Identifier: CC0-1.0
import base64
import sys
from pathlib import Path
if __name__ == '__main__':
for ui in Path('testsuite', 'reftests').glob('*.ui'):
for outputs in (
Path(
'debian', 'build', 'deb', 'testsuite', 'reftests',
'output',
),
):
diff = (outputs / (ui.stem + '.diff.png'))
if diff.exists():
ref = (outputs / (ui.stem + '.ref.png'))
out = (outputs / (ui.stem + '.out.png'))
for path in (ref, out, diff):
if path.exists():
print('')
print('begin-base64 644 %s' % path)
sys.stdout.flush()
with open(path, 'rb') as reader:
base64.encode(reader, sys.stdout.buffer)
print('====')
print('')
print('')