File: log-reftests.py

package info (click to toggle)
gtk%2B3.0 3.24.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 179,872 kB
  • sloc: ansic: 669,927; xml: 8,780; javascript: 6,630; python: 1,322; sh: 680; perl: 370; makefile: 212; cpp: 34
file content (33 lines) | stat: -rwxr-xr-x 1,032 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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('')