Skip to content

Commit

Permalink
test-image: remove if baseline and image is the same
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinerg committed Apr 7, 2020
1 parent 9907ab6 commit 03f7f88
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/image/compare_images
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,18 @@ do

# Do exact pixel comparison using ImageMagick
compare -verbose -metric AE "$3/$filename.baseline.png" "$3/$filename.png" "$3/$filename.diff.png" 2> "$3/$filename.txt"
cat "$3/$filename.txt"

# Check result and log
if grep -q "all: [^0]" "$3/$filename.txt"; then
# If it doesn't start by 0, they are different
cat "$3/$filename.txt"
else
# If it starts by 0, they are the same
rm "$3/$filename.txt"
rm "$3/$filename.diff.png"
rm "$3/$filename.baseline.png"
rm "$3/$filename.png"
fi
done

CODE=$(grep -R "all: [^0]" "$3"/*.txt | wc -l)
Expand Down

0 comments on commit 03f7f88

Please sign in to comment.