improved coding style of EPS test driver

v0.27.3
vog 14 years ago
parent 3c1d3d993b
commit 3434496d0d

@ -1,10 +1,10 @@
#! /bin/sh #! /bin/sh
# Test driver for EPS files # Test driver for EPS files
# ----------------------------------------------------------------------
# Setup
export LC_ALL=C export LC_ALL=C
cd tmp/ cd tmp/
if [ -z "$EXIV2_BINDIR" ] ; then if [ -z "$EXIV2_BINDIR" ] ; then
bin="$VALGRIND ../../src" bin="$VALGRIND ../../src"
samples="$VALGRIND ../../samples" samples="$VALGRIND ../../samples"
@ -12,18 +12,15 @@ else
bin="$VALGRIND $EXIV2_BINDIR" bin="$VALGRIND $EXIV2_BINDIR"
samples="$VALGRIND $EXIV2_BINDIR" samples="$VALGRIND $EXIV2_BINDIR"
fi fi
exiv2version="`$bin/exiv2 -V | sed -n '1 s,^exiv2 \([^ ]*\).*,\1,p'`" exiv2version="`$bin/exiv2 -V | sed -n '1 s,^exiv2 \([^ ]*\).*,\1,p'`"
if [ -z "$exiv2version" ]; then if [ -z "$exiv2version" ]; then
echo "Error: Unable to determine Exiv2 version" echo "Error: Unable to determine Exiv2 version"
exit 1 exit 1
fi fi
diffargs="--strip-trailing-cr" diffargs="--strip-trailing-cr"
if ! diff -q $diffargs /dev/null /dev/null 2>/dev/null ; then if ! diff -q $diffargs /dev/null /dev/null 2>/dev/null ; then
diffargs="" diffargs=""
fi fi
for file in ../data/eps/eps-*.eps.newxmp; do for file in ../data/eps/eps-*.eps.newxmp; do
if ! grep "@Exiv2Version@" "$file" >/dev/null ; then if ! grep "@Exiv2Version@" "$file" >/dev/null ; then
echo "Error: data/eps/$file contains hard-coded Exiv2 version" echo "Error: data/eps/$file contains hard-coded Exiv2 version"
@ -31,6 +28,8 @@ for file in ../data/eps/eps-*.eps.newxmp; do
fi fi
done done
# ----------------------------------------------------------------------
# Tests
( (
for file in ../data/eps/eps-*.eps; do for file in ../data/eps/eps-*.eps; do
image="`basename "$file" .eps`" image="`basename "$file" .eps`"
@ -118,9 +117,10 @@ done
echo "." echo "."
# ----------------------------------------------------------------------
# Result
if ! diff -q $diffargs "../data/eps/eps-test.out" "eps-test.out" ; then if ! diff -q $diffargs "../data/eps/eps-test.out" "eps-test.out" ; then
diff -u $diffargs "../data/eps/eps-test.out" "eps-test.out" diff -u $diffargs "../data/eps/eps-test.out" "eps-test.out"
exit 1 exit 1
fi fi
echo "All testcases passed." echo "All testcases passed."

Loading…
Cancel
Save