Update of /cvsroot/libexif/libexif-testsuite/tests
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16725/tests
Modified Files:
Makefile.am
Added Files:
check-no-unknown-tags.sh
Log Message:
Added check-no-unknown-tags.sh test to ensure that all EXIF tags are
recognized
Index: Makefile.am
===================================================================
RCS file: /cvsroot/libexif/libexif-testsuite/tests/Makefile.am,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -p -d -r1.21 -r1.22
--- Makefile.am 12 Dec 2008 07:14:38 -0000 1.21
+++ Makefile.am 13 Jan 2009 01:51:52 -0000 1.22
@@ -9,6 +9,7 @@ SUBDIRS = images
EXTRA_DIST = \
check-exif-executable.sh \
check-general-images.sh \
+ check-no-unknown-tags.sh \
check-994706.sh check-994706.b.patch \
check-1054321.sh 1054321.jpg \
check-1054322.sh 1054322.jpg \
@@ -24,7 +25,8 @@ check_SCRIPTS = \
check-1169170.sh
# This check script may take a little long - but it is invaluable. :)
-check_SCRIPTS += check-general-images.sh
+check_SCRIPTS += check-general-images.sh \
+ check-no-unknown-tags.sh
TESTS = $(check_SCRIPTS)
--- NEW FILE: check-no-unknown-tags.sh ---
#!/bin/sh
# Run all test images through exif and ensure that all the tags are known.
. 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
check_result () {
s="$?"
if test "$s" -eq 0; then
echo " ok."
else
echo " FAILED (${s})."
errors=$(expr $errors + 1)
if [ -z "$1" ] ; then
true cat "$tmpfile"
else
true cat "$1"
fi
continue
fi
}
echo Testing "$EXIFEXE"
errors=0
total=0
total_img=0
for img in "$TOPSRCDIR"/src/pel-images/*.jpg "$SRCDIR"/images/*.jpg
do
test -f "$img" || continue
# Test images without EXIF tags
case "$img" in
*-thumb* | *no-exif* | $NOEXIFLIST)
# skip image
continue
;;
esac
total_img=$(expr $total_img + 1)
echo -n "#${total_img} "
# Capture the debug logs
echo -n "Reading image \`${img}'..."
# Run this in the C language locale so the messages are known
env LANG=C LANGUAGE=C "$EXIFEXE" -d "${img}" > "$tmpfile" 2>&1
check_result
# Ensure all tags were understood
echo -n "Looking for unknown tags..."
! grep -q "Unknown tag" "$tmpfile"
check_result
done
rm "$tmpfile"
self="$(basename "$0")"
echo "$self: Checked $total_img images."
echo "$self: $errors checks failed."
test "$errors" -eq 0
|