summaryrefslogtreecommitdiff
path: root/test/comp
blob: b406607cb0b10372f12c83922a975860f7a70d6b (plain)
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
#!/bin/sh

usage()
{
	echo "usage: $0 [dir]" 1>&2
	exit 1
}


[ "$2" ] && usage
[ "${1#-}" != "$1" ] && usage

dir=${1:-.}

diffs=0
rm -f $dir/_diff*png
for n in $dir/out*.png; do
	out=`basename "$n"`
	ref=$dir/ref${out#out}
	diff=$dir/_diff${out#out}
	if ! compare -metric AE $ref $n - >/dev/null; then
		diffs=`expr $diffs + 1`
		compare -metric AE $ref $n $diff
	fi
done
echo
[ $diffs = 0 ] && exit 0
echo "$diffs difference(s)" 1>&2
exit 1