mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 19:38:02 +02:00
Run check-refs.sh in CI
The check-refs.sh script detects duplicate reference images. This commit adds it to be run by CI. For this, the script is extended with a proper exit code. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
d546a78c6f
commit
997870601b
2 changed files with 8 additions and 0 deletions
|
|
@ -246,6 +246,8 @@ fedora meson build:
|
|||
- (cd doc/public && bash "check-doc-syntax.sh")
|
||||
# FIXME: The following line really needs gtk-doc to run first
|
||||
- (cd doc/public && DOC_MODULE=cairo bash "check-doc-coverage.sh")
|
||||
# Check for duplicate reference images
|
||||
- ./test/check-refs.sh "$(pwd)/builddir/test/pdiff/perceptualdiff"
|
||||
|
||||
- ninja -C builddir install
|
||||
artifacts:
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ if [ ! -e "${pdiff}" ]; then
|
|||
exit 128
|
||||
fi
|
||||
|
||||
exit_code=0
|
||||
|
||||
for file in *.ref.png; do
|
||||
test=$(echo $file | cut -d'.' -f1)
|
||||
target=$(echo $file | cut -d'.' -f2)
|
||||
|
|
@ -48,6 +50,7 @@ for file in *.ref.png; do
|
|||
if [ -e $ref ]; then
|
||||
if cmp --silent "$ref" "$file" ; then
|
||||
printf "redundant: %s and %s are byte-by-byte identical files\n" $file $ref
|
||||
exit_code=1
|
||||
else
|
||||
# Run perceptualdiff with minimum threshold
|
||||
pdiff_output=$($pdiff $ref $file -threshold 1)
|
||||
|
|
@ -55,9 +58,12 @@ for file in *.ref.png; do
|
|||
notes=$(echo "${pdiff_output#*: }" | tail -n 1)
|
||||
if [ "$result" = "PASS" ] && [ "$notes" = "Images are binary identical" ]; then
|
||||
printf "redundant: %s and %s are pixel equivalent images\n" $file $ref
|
||||
exit_code=1
|
||||
notes=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
exit $exit_code
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue