File: compareoutputs

package info (click to toggle)
ctioga2 0.14.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 1,524 kB
  • sloc: ruby: 17,592; sh: 720; lisp: 88; makefile: 27
file content (33 lines) | stat: -rwxr-xr-x 785 bytes parent folder | download | duplicates (2)
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
30
31
32
33
#! /bin/bash

# A script that compares two runs of test2montage.
#
# Takes two arguments: the prefixes of the first and second series of
# file.

pref1=$1
pref2=$2

nb=0
for f in *.sh; do
    base=${f%%.sh}
    f1=outputs/${base}${pref1}.png
    f2=outputs/${base}${pref2}.png
    
    echo "Comparing $f1 and $f2:"
    if [ -r $f1 -a -r $f2 ]; then
        if diff <(pngtopnm $f1) <(pngtopnm $f2) > /dev/null; then
            echo ' -> identical'
        else
            echo ' -> different !'
            compare $f1 $f2 diff-$base.ppm
            convert $f1 diff-$base.ppm $f2 -append a-$base.ppm
            display a-$base.ppm &
            nb=$(($nb+1))
        fi
    else
        echo " -> impossible as both are not present"
    fi
done

echo "Found $nb files that differ"