summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorUli Schlachter <psychon@znc.in>2022-12-31 16:05:27 +0100
committerUli Schlachter <psychon@znc.in>2022-12-31 16:05:27 +0100
commit997870601bc2a1a8849f51c1055fc0c1f4d075ca (patch)
treedac99f8360d8366ad89843b94b1b1cfcd9ba12d3 /test
parentd546a78c6f12b02cf3e67c7e3c4e27c2825dd7ff (diff)
downloadcairo-997870601bc2a1a8849f51c1055fc0c1f4d075ca.tar.gz
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>
Diffstat (limited to 'test')
-rwxr-xr-xtest/check-refs.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/check-refs.sh b/test/check-refs.sh
index 81ef81b35..e2e8a1a2a 100755
--- a/test/check-refs.sh
+++ b/test/check-refs.sh
@@ -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