Debian Codegraph @

tests/compareoutputs

raw
1 #! /bin/bash
2
3 # A script that compares two runs of test2montage.
4 #
5 # Takes two arguments: the prefixes of the first and second series of
6 # file.
7
8 pref1=$1
9 pref2=$2
10
11 nb=0
12 for f in *.sh; do
13 base=${f%%.sh}
14 f1=outputs/${base}${pref1}.png
15 f2=outputs/${base}${pref2}.png
16
17 echo "Comparing $f1 and $f2:"
18 if [ -r $f1 -a -r $f2 ]; then
19 if diff <(pngtopnm $f1) <(pngtopnm $f2) > /dev/null; then
20 echo ' -> identical'
21 else
22 echo ' -> different !'
23 compare $f1 $f2 diff-$base.ppm
24 convert $f1 diff-$base.ppm $f2 -append a-$base.ppm
25 display a-$base.ppm &
26 nb=$(($nb+1))
27 fi
28 else
29 echo " -> impossible as both are not present"
30 fi
31 done
32
33 echo "Found $nb files that differ"