imageDiff.sh
1.72 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh -f
ARCHIVE_DIR=${ROOT}/PR/diags/rdp/archive
TNAME=""
##################################################
#
# Usage message
#
##################################################
usage()
{
echo "Usage: imageDiff.sh -n test_name"
exit 0
}
##################################################
#
# Compare .rgb, .cov, and .z files
#
# $1 = file prefix
#
##################################################
compare_function()
{
for sufx in rgb cov z
# for sufx in rgb
do
f1=OutData/${TNAME}_0.${sufx}
f2=${ARCHIVE_DIR}/${TNAME}_io_0.${sufx}.archive
df=OutData/${TNAME}_idf.${sufx}
if [ -r $f1 -a -r $f2 ]
then
${ROOT}/PR/rdpsim/tools/iclr $f1
if cmp -s $f1 $f2
then
echo "INFO: ${sufx} equate."
else
echo "ERROR: ${sufx} differ. Diff generated as $df."
${ROOT}/usr/sbin/idf -d $f1 $f2 $df
if [ $? -eq 0 ]
then
echo "HINT: Differences probably SOLELY due to dithering."
fi
fi
else
if [ ! -r $f1 ]
then
echo "ERROR: $f1 not present or not readable."
fi
if [ ! -r $f2 ]
then
echo "ERROR: $f2 not present or not readable."
fi
fi
done
}
##################################################
#
# Parse options
#
##################################################
while getopts "n:" a
do
case $a in
n) TNAME=$OPTARG;;
\?) usage ;;
esac
done
shift `expr $OPTIND - 1`
echo "\n"
echo "#"
echo "# Compare of image file to archived file"
echo "# `date`"
echo "#"
echo "INFO: ============== ${TNAME} =============="
compare_function
echo "\n"