diff --git a/test/addmoddel.sh b/test/addmoddel.sh index a4207317..ad4ccf5b 100755 --- a/test/addmoddel.sh +++ b/test/addmoddel.sh @@ -2,6 +2,13 @@ # Test driver to run the addmoddel sample program results="./tmp/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 exiv2="../../src/exiv2" @@ -12,10 +19,10 @@ $binpath/addmoddel exiv2-empty.jpg $binpath/exiv2 -pv exiv2-empty.jpg ) > $results -diff -q --strip-trailing-cr $results $good +diff -q $diffargs $results $good rc=$? if [ $rc -eq 0 ] ; then echo "All testcases passed." else - diff --strip-trailing-cr $results $good + diff $diffargs $results $good fi diff --git a/test/exiv2-test.sh b/test/exiv2-test.sh index ec94d786..6925bb22 100755 --- a/test/exiv2-test.sh +++ b/test/exiv2-test.sh @@ -4,6 +4,13 @@ LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH exiv2="../../src/exiv2" results="./tmp/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 \ exiv2-canon-powershot-s40.jpg \ @@ -85,10 +92,10 @@ diff iii kkk ) > $results 2>&1 -diff -q --strip-trailing-cr $results $good +diff -q -w $diffargs $results $good rc=$? if [ $rc -eq 0 ] ; then echo "All testcases passed." else - diff --strip-trailing-cr $results $good + diff -w $diffargs $results $good fi diff --git a/test/imagetest.sh b/test/imagetest.sh index eda1ce03..87eea658 100755 --- a/test/imagetest.sh +++ b/test/imagetest.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # Test driver for image file i/o eraseTest() diff --git a/test/iptctest.sh b/test/iptctest.sh index f34de93e..eb490dcf 100755 --- a/test/iptctest.sh +++ b/test/iptctest.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/sh # Test driver for Iptc metadata printTest() @@ -99,7 +99,7 @@ diffCheck() good=$2 #run diff and check results - diff -q --strip-trailing-cr $test $good + diff -q $diffargs $test $good if [ $? -ne 0 ]; then let ++errors else @@ -113,6 +113,13 @@ diffCheck() LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH binpath="../../src" 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" diff --git a/test/makernote-test.sh b/test/makernote-test.sh index f64abec4..7172b835 100755 --- a/test/makernote-test.sh +++ b/test/makernote-test.sh @@ -2,6 +2,13 @@ # Test driver for tests of MakerNoteFactory::match results="./tmp/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 binpath="../../src" @@ -9,10 +16,10 @@ cd ./tmp $binpath/makernote-test ) > $results -diff -q $results $good +diff -q $diffargs $results $good rc=$? if [ $rc -eq 0 ] ; then echo "All testcases passed." else - diff $results $good + diff $diffargs $results $good fi diff --git a/test/write-test.sh b/test/write-test.sh index 1fa9a7e6..c2d73062 100755 --- a/test/write-test.sh +++ b/test/write-test.sh @@ -34,6 +34,13 @@ runTestCase() LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH binpath="../../src" 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 \ exiv2-kodak-dc210.jpg \ @@ -60,10 +67,10 @@ runTestCase 11 $datapath/exiv2-nikon-d70.jpg ) > 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=$? if [ $rc -eq 0 ] ; then echo "All testcases passed." 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 diff --git a/test/write2-test.sh b/test/write2-test.sh index fef8d6a3..bd19ff10 100755 --- a/test/write2-test.sh +++ b/test/write2-test.sh @@ -2,6 +2,13 @@ # Test driver for write unit tests to build Exif metadata from scratch results="./tmp/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 binpath="../../src" @@ -10,10 +17,10 @@ cd ./tmp $binpath/write2-test exiv2-empty.jpg ) > $results -diff -q $results $good +diff -q $diffargs $results $good rc=$? if [ $rc -eq 0 ] ; then echo "All testcases passed." else - diff $results $good + diff $diffargs $results $good fi