* test/Makefile.am: Add some tests for tiff2bw.

This commit is contained in:
Bob Friesenhahn 2017-11-02 13:51:22 +00:00
parent 25f9ffa565
commit 45065882ae
6 changed files with 102 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2017-11-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* test/Makefile.am: Add some tests for tiff2bw.
2017-11-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* tools/tiff2bw.c (main): Free memory allocated in the tiff2bw

View File

@ -53,7 +53,8 @@ CLEANFILES = test_packbits.tif o-*
if HAVE_JPEG
JPEG_DEPENDENT_CHECK_PROG=raw_decode
JPEG_DEPENDENT_TESTSCRIPTS=tiff2rgba-quad-tile.jpg.sh
JPEG_DEPENDENT_TESTSCRIPTS=\
tiff2rgba-quad-tile.jpg.sh
else
JPEG_DEPENDENT_CHECK_PROG=
JPEG_DEPENDENT_TESTSCRIPTS=
@ -127,6 +128,9 @@ TESTSCRIPTS = \
tiffcrop-R90-palette-1c-8b.sh \
tiffcrop-R90-rgb-3c-16b.sh \
tiffcrop-R90-rgb-3c-8b.sh \
tiff2bw-palette-1c-8b.sh \
tiff2bw-quad-lzw-compat.sh \
tiff2bw-rgb-3c-8b.sh \
tiff2rgba-logluv-3c-16b.sh \
tiff2rgba-minisblack-1c-16b.sh \
tiff2rgba-minisblack-1c-8b.sh \
@ -209,6 +213,26 @@ memcheck:
ptrcheck:
$(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
# tiff2bw is pretty lame so currently only the generated scripts
# tiff2bw-palette-1c-8b.sh, tiff2bw-quad-lzw-compat.sh, and
# tiff2bw-rgb-3c-8b.sh pass tests.
generate-tiff2bw-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiff2bw-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiff2bw-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFF2BW\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
generate-tiff2rgba-tests:
for file in $(TIFFIMAGES) ; \
do \
@ -305,5 +329,6 @@ generate-tiffcrop-tests: \
generate-tiffcrop-extractz14-tests
generate-tests: \
generate-tiff2bw-tests \
generate-tiff2rgba-tests \
generate-tiffcrop-tests

View File

@ -451,8 +451,9 @@ am__EXEEXT_3 = ppm2tiff_pbm.sh ppm2tiff_pgm.sh ppm2tiff_ppm.sh \
tiffcrop-R90-miniswhite-1c-1b.sh tiffcrop-R90-palette-1c-1b.sh \
tiffcrop-R90-palette-1c-4b.sh tiffcrop-R90-palette-1c-8b.sh \
tiffcrop-R90-rgb-3c-16b.sh tiffcrop-R90-rgb-3c-8b.sh \
tiff2rgba-logluv-3c-16b.sh tiff2rgba-minisblack-1c-16b.sh \
tiff2rgba-minisblack-1c-8b.sh \
tiff2bw-palette-1c-8b.sh tiff2bw-quad-lzw-compat.sh \
tiff2bw-rgb-3c-8b.sh tiff2rgba-logluv-3c-16b.sh \
tiff2rgba-minisblack-1c-16b.sh tiff2rgba-minisblack-1c-8b.sh \
tiff2rgba-minisblack-2c-8b-alpha.sh \
tiff2rgba-miniswhite-1c-1b.sh tiff2rgba-palette-1c-1b.sh \
tiff2rgba-palette-1c-4b.sh tiff2rgba-palette-1c-8b.sh \
@ -653,7 +654,9 @@ CLEANFILES = test_packbits.tif o-*
@HAVE_JPEG_FALSE@JPEG_DEPENDENT_CHECK_PROG =
@HAVE_JPEG_TRUE@JPEG_DEPENDENT_CHECK_PROG = raw_decode
@HAVE_JPEG_FALSE@JPEG_DEPENDENT_TESTSCRIPTS =
@HAVE_JPEG_TRUE@JPEG_DEPENDENT_TESTSCRIPTS = tiff2rgba-quad-tile.jpg.sh
@HAVE_JPEG_TRUE@JPEG_DEPENDENT_TESTSCRIPTS = \
@HAVE_JPEG_TRUE@ tiff2rgba-quad-tile.jpg.sh
# Test scripts to execute
TESTSCRIPTS = \
@ -718,6 +721,9 @@ TESTSCRIPTS = \
tiffcrop-R90-palette-1c-8b.sh \
tiffcrop-R90-rgb-3c-16b.sh \
tiffcrop-R90-rgb-3c-8b.sh \
tiff2bw-palette-1c-8b.sh \
tiff2bw-quad-lzw-compat.sh \
tiff2bw-rgb-3c-8b.sh \
tiff2rgba-logluv-3c-16b.sh \
tiff2rgba-minisblack-1c-16b.sh \
tiff2rgba-minisblack-1c-8b.sh \
@ -1562,6 +1568,27 @@ tiffcrop-R90-rgb-3c-8b.sh.log: tiffcrop-R90-rgb-3c-8b.sh
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
tiff2bw-palette-1c-8b.sh.log: tiff2bw-palette-1c-8b.sh
@p='tiff2bw-palette-1c-8b.sh'; \
b='tiff2bw-palette-1c-8b.sh'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
tiff2bw-quad-lzw-compat.sh.log: tiff2bw-quad-lzw-compat.sh
@p='tiff2bw-quad-lzw-compat.sh'; \
b='tiff2bw-quad-lzw-compat.sh'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
tiff2bw-rgb-3c-8b.sh.log: tiff2bw-rgb-3c-8b.sh
@p='tiff2bw-rgb-3c-8b.sh'; \
b='tiff2bw-rgb-3c-8b.sh'; \
$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
tiff2rgba-logluv-3c-16b.sh.log: tiff2rgba-logluv-3c-16b.sh
@p='tiff2rgba-logluv-3c-16b.sh'; \
b='tiff2rgba-logluv-3c-16b.sh'; \
@ -1835,6 +1862,26 @@ memcheck:
ptrcheck:
$(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
# tiff2bw is pretty lame so currently only the generated scripts
# tiff2bw-palette-1c-8b.sh, tiff2bw-quad-lzw-compat.sh, and
# tiff2bw-rgb-3c-8b.sh pass tests.
generate-tiff2bw-tests:
for file in $(TIFFIMAGES) ; \
do \
base=`basename $$file .tiff` ; \
testscript=$(srcdir)/tiff2bw-$$base.sh ; \
( \
echo "#!/bin/sh" ; \
echo "# Generated file, master is Makefile.am" ; \
echo ". \$${srcdir:-.}/common.sh" ; \
echo "infile=\"\$$srcdir/$$file\"" ; \
echo "outfile=\"o-tiff2bw-$$base.tiff\"" ; \
echo "f_test_convert \"\$$TIFF2BW\" \$$infile \$$outfile" ; \
echo "f_tiffinfo_validate \$$outfile" ; \
) > $$testscript ; \
chmod +x $$testscript ; \
done
generate-tiff2rgba-tests:
for file in $(TIFFIMAGES) ; \
do \
@ -1931,6 +1978,7 @@ generate-tiffcrop-tests: \
generate-tiffcrop-extractz14-tests
generate-tests: \
generate-tiff2bw-tests \
generate-tiff2rgba-tests \
generate-tiffcrop-tests

7
test/tiff2bw-palette-1c-8b.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Generated file, master is Makefile.am
. ${srcdir:-.}/common.sh
infile="$srcdir/images/palette-1c-8b.tiff"
outfile="o-tiff2bw-palette-1c-8b.tiff"
f_test_convert "$TIFF2BW" $infile $outfile
f_tiffinfo_validate $outfile

View File

@ -0,0 +1,7 @@
#!/bin/sh
# Generated file, master is Makefile.am
. ${srcdir:-.}/common.sh
infile="$srcdir/images/quad-lzw-compat.tiff"
outfile="o-tiff2bw-quad-lzw-compat.tiff"
f_test_convert "$TIFF2BW" $infile $outfile
f_tiffinfo_validate $outfile

7
test/tiff2bw-rgb-3c-8b.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
# Generated file, master is Makefile.am
. ${srcdir:-.}/common.sh
infile="$srcdir/images/rgb-3c-8b.tiff"
outfile="o-tiff2bw-rgb-3c-8b.tiff"
f_test_convert "$TIFF2BW" $infile $outfile
f_tiffinfo_validate $outfile