mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 14:38:13 +02:00
test: Use cmp to catch byte-by-byte identical files
cmp runs faster than perceptualdiff, and catches files that are exact copies of the reference image. We still use perceptualdiff for catching files that aren't bytewise identical, but are still identical at the pixel level. Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
This commit is contained in:
parent
b0be0d8d42
commit
8d3c518e9d
1 changed files with 12 additions and 8 deletions
|
|
@ -47,14 +47,18 @@ for file in *.ref.png; do
|
|||
fi
|
||||
|
||||
if [ -e $ref ]; then
|
||||
# Run perceptualdiff with minimum threshold
|
||||
pdiff_output=$($pdiff $ref $file -threshold 1)
|
||||
result=${pdiff_output%:*}
|
||||
notes=$(echo "${pdiff_output#*: }" | tail -n 1)
|
||||
if [ "$result" = "PASS" ] && [ "$notes" = "Images are binary identical" ]; then
|
||||
printf "redundant: %s is binary identical to %s\n" $file $ref
|
||||
notes=""
|
||||
fi
|
||||
if cmp --silent "$ref" "$file" ; then
|
||||
printf "redundant: %s and %s are byte-by-byte identical files\n" $file $ref
|
||||
else
|
||||
# Run perceptualdiff with minimum threshold
|
||||
pdiff_output=$($pdiff $ref $file -threshold 1)
|
||||
result=${pdiff_output%:*}
|
||||
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
|
||||
notes=""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue