From: Dan F. <dfa...@us...> - 2009-01-13 23:17:32
|
Update of /cvsroot/libexif/libexif-testsuite/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15109 Modified Files: check-general-images.sh check-no-unknown-tags.sh check-vars.sh.in Log Message: Moved the list of images to test into check-vars.sh to centralize the setup and easily allow local repositories of test images to be added. Index: check-vars.sh.in =================================================================== RCS file: /cvsroot/libexif/libexif-testsuite/tests/check-vars.sh.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -d -r1.1 -r1.2 --- check-vars.sh.in 12 Dec 2008 07:14:38 -0000 1.1 +++ check-vars.sh.in 13 Jan 2009 22:31:46 -0000 1.2 @@ -8,3 +8,17 @@ TOPSRCDIR=@top_srcdir@ TOPBLDDIR=@top_builddir@ EXIFEXE=`if test -x "$TOPBLDDIR/src/exif/exif/exif"; then echo "$TOPBLDDIR/src/exif/exif/exif"; elif test -x "$BINDIR/exif"; then echo "$BINDIR/exif"; else echo "Neither $TOPBLDDIR/src/exif/exif/exif nor $BINDIR/exif are executable." >&2; echo false; exit 1; fi` DIFFEXE=@DIFF@ + +# space-separated list of all JPEG images to test +ALLFILES="$TOPSRCDIR/src/pel-images/*.jpg $SRCDIR/images/*.jpg" + +# Function that returns true when the given file contains no EXIF tags +noexiftags () { + # Test images without EXIF tags + case "$1" in + *-thumb* | *no-exif* | *canon-powershot-a400-001.jpg) + return 0 # No EXIF tags in this image + ;; + esac + return 1 # normal image with EXIF tags +} Index: check-general-images.sh =================================================================== RCS file: /cvsroot/libexif/libexif-testsuite/tests/check-general-images.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -p -d -r1.3 -r1.4 --- check-general-images.sh 10 Jan 2009 08:38:03 -0000 1.3 +++ check-general-images.sh 13 Jan 2009 22:31:46 -0000 1.4 @@ -4,9 +4,6 @@ . check-vars.sh -# |-separated list of test suite images that don't contain EXIF tags -NOEXIFLIST='*canon-powershot-a400-001.jpg' - tmpfile="./output.tmp" tmpimg="./general.out.jpg" @@ -16,28 +13,26 @@ errors=0 total=0 total_img=0 -for img in "$TOPSRCDIR"/src/pel-images/*.jpg "$SRCDIR"/images/*.jpg +for img in $ALLFILES do test -f "$img" || continue total_img=$(expr $total_img + 1) echo \#${total_img} # Test images without EXIF tags - case "$img" in - *-thumb* | *no-exif* | $NOEXIFLIST) - echo -n "Attempting list of nonexistent EXIF data from \`${img}'..." - "$EXIFEXE" "${img}" > "$tmpfile" 2>&1 - s="$?" - if test "$s" -eq 1; then - echo " ok." - else - echo " FAILED (${s})." - errors=$(expr $errors + 1) - cat "$tmpfile" - fi - continue - ;; - esac + if noexiftags "$img" ; then + echo -n "Attempting list of nonexistent EXIF data from \`${img}'..." + "$EXIFEXE" "${img}" > "$tmpfile" 2>&1 + s="$?" + if test "$s" -eq 1; then + echo " ok." + else + echo " FAILED (${s})." + errors=$(expr $errors + 1) + cat "$tmpfile" + fi + continue + fi # Check that listing EXIF info works echo -n "Listing EXIF info from \`${img}'..." Index: check-no-unknown-tags.sh =================================================================== RCS file: /cvsroot/libexif/libexif-testsuite/tests/check-no-unknown-tags.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -d -r1.1 -r1.2 --- check-no-unknown-tags.sh 13 Jan 2009 01:51:52 -0000 1.1 +++ check-no-unknown-tags.sh 13 Jan 2009 22:31:46 -0000 1.2 @@ -3,9 +3,6 @@ . check-vars.sh -# |-separated list of test suite images that don't contain EXIF tags -NOEXIFLIST='*canon-powershot-a400-001.jpg' - tmpfile="./output.tmp" # Display ok or FAILED depending on the result code @@ -31,17 +28,13 @@ errors=0 total=0 total_img=0 -for img in "$TOPSRCDIR"/src/pel-images/*.jpg "$SRCDIR"/images/*.jpg +for img in $ALLFILES do test -f "$img" || continue - # Test images without EXIF tags - case "$img" in - *-thumb* | *no-exif* | $NOEXIFLIST) - # skip image - continue - ;; - esac + if noexiftags "$img" ; then + continue # skip image + fi total_img=$(expr $total_img + 1) echo -n "#${total_img} " |