Update of /cvsroot/libexif/libexif-testsuite/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11234/tests Modified Files: Makefile.am Added Files: check-1054321.sh check-1054322.sh check-1054323.sh check-1169170.sh check-994706.sh check-exif-executable.sh check-general-images.sh check-vars.sh.in Removed Files: check-1054321.in check-1054322.in check-1054323.in check-1169170.in check-994706.in check-exif-executable.in check-general-images.in Log Message: Created check-vars.sh script to eliminate the need to generate all the tests scripts at build time --- NEW FILE: check-vars.sh.in --- # Specifies autoconf variables for use by the test scripts prefix=@prefix@ exec_prefix=@exec_prefix@ BINDIR=@bindir@ SRCDIR=@srcdir@ 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@ --- NEW FILE: check-1054322.sh --- #!/bin/sh . check-vars.sh result_file="result-1054322-1.tmp" "$EXIFEXE" --remove-thumbnail --output ./1054322-1.out.jpg "$SRCDIR"/1054322.jpg > ${result_file} 2>&1 result="`cat ${result_file}`" s="$?" echo "$result" if echo "$result" | grep "The data supplied does not seem to contain EXIF data." > /dev/null; then : elif test "$s" -eq 0; then echo "Exit code $s reading EXIF from an HTML file? That must be wrong." exit 1 else echo "Exit code $s" exit 1 fi result_file="result-1054322-2.tmp" "$EXIFEXE" --remove-thumbnail --output ./1054323-2.out.jpg ./this-file-does-not-exist.jpg > ${result_file} 2>&1 result="`cat ${result_file}`" s="$?" echo "$result" if echo "$result" | grep "does not contain EXIF data" > /dev/null; then : elif test "$s" -eq 0; then echo "Exit code $s reading EXIF from a nonexisting file? That must be wrong." exit 1 else echo "Exit code $s" exit 1 fi exit 0 --- check-1054323.in DELETED --- Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/libexif-testsuite/tests/Makefile.am,v retrieving revision 1.20 retrieving revision 1.21 diff -u -p -d -r1.20 -r1.21 --- Makefile.am 22 May 2007 23:30:54 -0000 1.20 +++ Makefile.am 12 Dec 2008 07:14:38 -0000 1.21 @@ -5,14 +5,15 @@ SUBDIRS = images +# check-vars.sh.in is automatically included EXTRA_DIST = \ - check-exif-executable.in \ - check-general-images.in \ - check-994706.in check-994706.b.patch \ - check-1054321.in 1054321.jpg \ - check-1054322.in 1054322.jpg \ - check-1054323.in 1054323.jpg \ - check-1169170.in + check-exif-executable.sh \ + check-general-images.sh \ + check-994706.sh check-994706.b.patch \ + check-1054321.sh 1054321.jpg \ + check-1054322.sh 1054322.jpg \ + check-1054323.sh 1054323.jpg \ + check-1169170.sh if HAVE_EXIF_CLI @@ -29,13 +30,5 @@ TESTS = $(check_SCRIPTS) endif -CLEANFILES = $(check_SCRIPTS) *.out.jpg *.dst.txt *.src.txt *.modified.jpeg *.a.patch *.xpatch *.tmp - -# The embedded script for @exif@ is supposed to run at the time the -# .sh file is running. If not, we try to run the installed version. -# If that doesn't work, either, we fail. -.in.sh: Makefile - @echo "Creating $@" - @sed 's|@exif\@|`if test -x "$(top_builddir)/src/exif/exif/exif"; then echo "$(top_builddir)/src/exif/exif/exif"; elif test -x "$(bindir)/exif"; then echo "$(bindir)/exif"; else echo "Neither $(top_builddir)/src/exif/exif/exif nor $(bindir)/exif are executable." >&2; echo false; exit 1; fi`|g;s|@top_srcdir\@|$(top_srcdir)|g;s|@srcdir\@|$(srcdir)|g;s|@diff\@|$(DIFF)|g' < $< > $@ - @chmod +x $@ +CLEANFILES = *.out.jpg *.dst.txt *.src.txt *.modified.jpeg *.a.patch *.xpatch *.tmp --- check-1054322.in DELETED --- --- NEW FILE: check-general-images.sh --- #!/bin/sh # Execute a number of common sense checks on "real" images # (not specially prepared images) . 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="./output.jpg" 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 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 # Check that listing EXIF info works echo -n "Listing EXIF info from \`${img}'..." # Run this in the C locale so the messages are known env LANG=C LANGUAGE=C "$EXIFEXE" "${img}" > "$tmpfile" 2>&1 s="$?" if test "$s" -eq 0; then echo " ok." else echo " FAILED (${s})." errors=$(expr $errors + 1) cat "$tmpfile" continue # if listing EXIF info fails, the other tests cannot work anyway fi total=$(expr $total + 1) check_makernote= grep "^Maker Note" < "$tmpfile" > /dev/null && check_makernote=true check_thumbnail= grep "^EXIF data contains a thumbnail" < "$tmpfile" > /dev/null && check_thumbnail=true rm -f "$tmpfile" # Check that listing the makernote works echo -n "Listing MNote info from \`${img}'..." "$EXIFEXE" --show-mnote "${img}" > "$tmpfile" 2>&1 s="$?" if test "$s" -eq 0; then echo " ok." else echo " FAILED (${s})." errors=$(expr $errors + 1) cat "$tmpfile" fi total=$(expr $total + 1) # Check that removing a tag works echo -n "Removing tag from \`${img}'..." "$EXIFEXE" --tag=DateTime --remove "${img}" -o "$tmpimg" > "$tmpfile" 2>&1 s="$?" if test "$s" -eq 0; then echo " ok." else echo " FAILED (${s})." errors=$(expr $errors + 1) cat "$tmpfile" fi total=$(expr $total + 1) # Check that the tag is removed echo -n "Listing tag from \`${tmpimg}'..." "$EXIFEXE" --tag=DateTime "${tmpimg}" > "$tmpfile" 2>&1 s="$?" if test "$s" -eq 1; then echo " ok." else echo " FAILED (${s})." errors=$(expr $errors + 1) cat "$tmpfile" fi total=$(expr $total + 1) # Check that listing EXIF info still works echo -n "Listing EXIF info from \`${tmpimg}'..." "$EXIFEXE" "${tmpimg}" > "$tmpfile" 2>&1 s="$?" if test "$s" -eq 0; then echo " ok." else echo " FAILED (${s})." errors=$(expr $errors + 1) cat "$tmpfile" fi total=$(expr $total + 1) # Check that listing the makernote still works echo -n "Listing MNote info from \`${tmpimg}'..." "$EXIFEXE" --show-mnote "${tmpimg}" > "$tmpfile" 2>&1 s="$?" if test "$s" -eq 0; then echo " ok." else echo " FAILED (${s})." errors=$(expr $errors + 1) cat "$tmpfile" fi total=$(expr $total + 1) # Check that extracting thumbnail works if [ "$check_thumbnail" ] ; then echo -n "Extracting thumbnail from ${img}" thumb="./$(basename "$img").check-general-images.thumb.out.jpg" "$EXIFEXE" -e -o "$thumb" "$img" > "$tmpfile" 2>&1 s="$?" if test "$s" -eq 0; then echo " ok." else echo " FAILED (${s})." errors=$(expr $errors + 1) cat "$tmpfile" fi rm -f "$tmpfile" total=$(expr $total + 1) else echo "Skipping extract thumbnail test on ${img}" fi done self="$(basename "$0")" echo "$self: Performed $total checks on $total_img images." echo "$self: $errors checks failed." test "$errors" -eq 0 --- NEW FILE: check-exif-executable.sh --- #!/bin/sh . check-vars.sh if test -x "$EXIFEXE"; then echo "exif executable \`$EXIFEXE\' is executable. Good." ls -l "$EXIFEXE" else echo "exif executable \`$EXIFEXE\' is NOT executable. Bad." ls -l "$EXIFEXE" exit 1 fi --- check-general-images.in DELETED --- --- check-exif-executable.in DELETED --- --- check-1169170.in DELETED --- --- NEW FILE: check-1054323.sh --- #!/bin/sh . check-vars.sh set -x "$EXIFEXE" -r -o ./1054323.out.jpg "$SRCDIR"/1054323.jpg --- check-1054321.in DELETED --- --- NEW FILE: check-1054321.sh --- #!/bin/sh . check-vars.sh result_file="result-1054321.tmp" #set -x "$EXIFEXE" -m -o ./1054321.out.jpg "$SRCDIR"/1054321.jpg > "$result_file" 2>&1 s="$?" tail "$result_file" exit "$s" --- NEW FILE: check-1169170.sh --- #!/bin/sh . check-vars.sh if "$EXIFEXE" "$SRCDIR/images/canon-powershot-a400-001.jpg" > /dev/null 2>&1; then echo "This should have failed." exit 1 fi if "$EXIFEXE" --show-mnote "$SRCDIR/images/canon-powershot-a400-001.jpg" > /dev/null 2>&1; then echo "This should have failed." exit 1 fi "$EXIFEXE" "$SRCDIR/images/canon-powershot-g2-001.jpg" > /dev/null 2>&1 || exit $? "$EXIFEXE" --show-mnote "$SRCDIR/images/canon-powershot-g2-001.jpg" > /dev/null 2>&1 || exit $? exit 0 --- NEW FILE: check-994706.sh --- #!/bin/sh . check-vars.sh bug="994706" srcimg="$SRCDIR/images/canon-powershot-g2-001.jpg" dstimg="./${bug}.jpg.modified.jpeg" # Remove Maker Note echo "Removing EXIF Maker Note" "$EXIFEXE" "--ifd=EXIF" "--tag=Maker Note" --remove --output "$dstimg" "$srcimg" > /dev/null 2>&1 # List all tags "$EXIFEXE" --list-tags "$srcimg" | sed '1d' > "./check-${bug}.src.txt" "$EXIFEXE" --list-tags "$dstimg" | sed '1d' > "./check-${bug}.dst.txt" # Find different tags in source and destination image "$DIFFEXE" -u "./check-${bug}.src.txt" "./check-${bug}.dst.txt" > "./check-${bug}.a.patch" # Canonicalize diff files sed '1,3 d' < "./check-${bug}.a.patch" > "./check-${bug}.a.xpatch" sed '1,3 d' < "$SRCDIR/check-${bug}.b.patch" > "./check-${bug}.b.xpatch" # Compare diff files; they should be equal. "$DIFFEXE" -u "./check-${bug}.a.xpatch" "./check-${bug}.b.xpatch" s="$?" if test "$s" -ne 0; then echo "The Maker Note should have been removed. Bad." fi exit "$s" --- check-994706.in DELETED --- |