1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-22 20:53:44 +02:00
eda-tools/eeshow/test/comp

30 lines
444 B
Plaintext
Raw Permalink Normal View History

2016-08-02 17:00:08 +03:00
#!/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