Fixed test drivers for use in MinGW

v0.27.3
Andreas Huggel 21 years ago
parent 875cb0892e
commit 72c6c67c34

@ -2,6 +2,13 @@
# Test driver to run the addmoddel sample program # Test driver to run the addmoddel sample program
results="./tmp/addmoddel.out" results="./tmp/addmoddel.out"
good="./data/addmoddel.out" good="./data/addmoddel.out"
diffargs="--strip-trailing-cr"
tmpfile=tmp/ttt
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
diffargs=""
fi
( (
LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH
exiv2="../../src/exiv2" exiv2="../../src/exiv2"
@ -12,10 +19,10 @@ $binpath/addmoddel exiv2-empty.jpg
$binpath/exiv2 -pv exiv2-empty.jpg $binpath/exiv2 -pv exiv2-empty.jpg
) > $results ) > $results
diff -q --strip-trailing-cr $results $good diff -q $diffargs $results $good
rc=$? rc=$?
if [ $rc -eq 0 ] ; then if [ $rc -eq 0 ] ; then
echo "All testcases passed." echo "All testcases passed."
else else
diff --strip-trailing-cr $results $good diff $diffargs $results $good
fi fi

@ -4,6 +4,13 @@ LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH
exiv2="../../src/exiv2" exiv2="../../src/exiv2"
results="./tmp/exiv2-test.out" results="./tmp/exiv2-test.out"
good="./data/exiv2-test.out" good="./data/exiv2-test.out"
diffargs="--strip-trailing-cr"
tmpfile=tmp/ttt
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
diffargs=""
fi
( (
images="exiv2-empty.jpg \ images="exiv2-empty.jpg \
exiv2-canon-powershot-s40.jpg \ exiv2-canon-powershot-s40.jpg \
@ -85,10 +92,10 @@ diff iii kkk
) > $results 2>&1 ) > $results 2>&1
diff -q --strip-trailing-cr $results $good diff -q -w $diffargs $results $good
rc=$? rc=$?
if [ $rc -eq 0 ] ; then if [ $rc -eq 0 ] ; then
echo "All testcases passed." echo "All testcases passed."
else else
diff --strip-trailing-cr $results $good diff -w $diffargs $results $good
fi fi

@ -1,4 +1,4 @@
#! /bin/bash #! /bin/sh
# Test driver for image file i/o # Test driver for image file i/o
eraseTest() eraseTest()

@ -1,4 +1,4 @@
#! /bin/bash #! /bin/sh
# Test driver for Iptc metadata # Test driver for Iptc metadata
printTest() printTest()
@ -99,7 +99,7 @@ diffCheck()
good=$2 good=$2
#run diff and check results #run diff and check results
diff -q --strip-trailing-cr $test $good diff -q $diffargs $test $good
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
let ++errors let ++errors
else else
@ -113,6 +113,13 @@ diffCheck()
LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH
binpath="../../src" binpath="../../src"
datapath="../data" datapath="../data"
diffargs="--strip-trailing-cr"
tmpfile=tmp/ttt
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
diffargs=""
fi
test_files="smiley1.jpg smiley2.jpg glider.exv table.jpg" test_files="smiley1.jpg smiley2.jpg glider.exv table.jpg"

@ -2,6 +2,13 @@
# Test driver for tests of MakerNoteFactory::match # Test driver for tests of MakerNoteFactory::match
results="./tmp/makernote-test.out" results="./tmp/makernote-test.out"
good="./data/makernote-test.out" good="./data/makernote-test.out"
diffargs="--strip-trailing-cr"
tmpfile=tmp/ttt
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
diffargs=""
fi
( (
LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH
binpath="../../src" binpath="../../src"
@ -9,10 +16,10 @@ cd ./tmp
$binpath/makernote-test $binpath/makernote-test
) > $results ) > $results
diff -q $results $good diff -q $diffargs $results $good
rc=$? rc=$?
if [ $rc -eq 0 ] ; then if [ $rc -eq 0 ] ; then
echo "All testcases passed." echo "All testcases passed."
else else
diff $results $good diff $diffargs $results $good
fi fi

@ -34,6 +34,13 @@ runTestCase()
LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH
binpath="../../src" binpath="../../src"
datapath="." datapath="."
diffargs="--strip-trailing-cr"
tmpfile=tmp/ttt
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
diffargs=""
fi
images="exiv2-canon-powershot-s40.jpg \ images="exiv2-canon-powershot-s40.jpg \
exiv2-kodak-dc210.jpg \ exiv2-kodak-dc210.jpg \
@ -60,10 +67,10 @@ runTestCase 11 $datapath/exiv2-nikon-d70.jpg
) > tmp/write-test.out 2>&1 ) > tmp/write-test.out 2>&1
diff -q --strip-trailing-cr tmp/write-test.out data/write-test.out diff -q -w $diffargs tmp/write-test.out data/write-test.out
rc=$? rc=$?
if [ $rc -eq 0 ] ; then if [ $rc -eq 0 ] ; then
echo "All testcases passed." echo "All testcases passed."
else else
diff --strip-trailing-cr tmp/write-test.out data/write-test.out diff -w $diffargs tmp/write-test.out data/write-test.out
fi fi

@ -2,6 +2,13 @@
# Test driver for write unit tests to build Exif metadata from scratch # Test driver for write unit tests to build Exif metadata from scratch
results="./tmp/write2-test.out" results="./tmp/write2-test.out"
good="./data/write2-test.out" good="./data/write2-test.out"
diffargs="--strip-trailing-cr"
tmpfile=tmp/ttt
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
diffargs=""
fi
( (
LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH
binpath="../../src" binpath="../../src"
@ -10,10 +17,10 @@ cd ./tmp
$binpath/write2-test exiv2-empty.jpg $binpath/write2-test exiv2-empty.jpg
) > $results ) > $results
diff -q $results $good diff -q $diffargs $results $good
rc=$? rc=$?
if [ $rc -eq 0 ] ; then if [ $rc -eq 0 ] ; then
echo "All testcases passed." echo "All testcases passed."
else else
diff $results $good diff $diffargs $results $good
fi fi

Loading…
Cancel
Save