1# Tag Image File Format (TIFF) Software 2# 3# Copyright (C) 2004, Andrey Kiselev <[email protected]> 4# 5# Permission to use, copy, modify, distribute, and sell this software and 6# its documentation for any purpose is hereby granted without fee, provided 7# that (i) the above copyright notices and this permission notice appear in 8# all copies of the software and related documentation, and (ii) the names of 9# Sam Leffler and Silicon Graphics may not be used in any advertising or 10# publicity relating to the software without the specific, prior written 11# permission of Sam Leffler and Silicon Graphics. 12# 13# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 14# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 15# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 16# 17# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 18# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 19# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 20# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 21# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 22# OF THIS SOFTWARE. 23 24# Process this file with automake to produce Makefile.in. 25 26AUTOMAKE_OPTIONS = 1.12 color-tests parallel-tests foreign 27 28LIBTIFF = $(top_builddir)/libtiff/libtiff.la 29 30# Environment parameters to be used during tests 31TESTS_ENVIRONMENT = \ 32 MAKE="$(MAKE)" \ 33 MAKEFLAGS="$(MAKEFLAGS)" \ 34 MEMCHECK="$(MEMCHECK)" 35 36EXTRA_DIST = \ 37 $(TESTSCRIPTS) \ 38 $(IMAGES_EXTRA_DIST) \ 39 CMakeLists.txt \ 40 common.sh \ 41 TiffSplitTest.cmake \ 42 TiffTestCommon.cmake \ 43 TiffTest.cmake 44 45# All of the tests to execute via 'make check' 46TESTS = $(check_PROGRAMS) $(TESTSCRIPTS) 47 48# Tests which are expected to fail 49XFAIL_TESTS = 50 51# Extra files which should be cleaned by 'make clean' 52CLEANFILES = test_packbits.tif o-* 53 54if HAVE_JPEG 55JPEG_DEPENDENT_CHECK_PROG=raw_decode 56JPEG_DEPENDENT_TESTSCRIPTS=tiff2rgba-quad-tile.jpg.sh 57else 58JPEG_DEPENDENT_CHECK_PROG= 59JPEG_DEPENDENT_TESTSCRIPTS= 60endif 61 62# Executable programs which need to be built in order to support tests 63check_PROGRAMS = \ 64 ascii_tag long_tag short_tag strip_rw rewrite custom_dir \ 65 $(JPEG_DEPENDENT_CHECK_PROG) 66 67# Test scripts to execute 68TESTSCRIPTS = \ 69 ppm2tiff_pbm.sh \ 70 ppm2tiff_pgm.sh \ 71 ppm2tiff_ppm.sh \ 72 tiffcp-g3.sh \ 73 tiffcp-g3-1d.sh \ 74 tiffcp-g3-1d-fill.sh \ 75 tiffcp-g3-2d.sh \ 76 tiffcp-g3-2d-fill.sh \ 77 tiffcp-g4.sh \ 78 tiffcp-logluv.sh \ 79 tiffcp-thumbnail.sh \ 80 tiffdump.sh \ 81 tiffinfo.sh \ 82 tiffcp-split.sh \ 83 tiffcp-split-join.sh \ 84 tiff2ps-PS1.sh \ 85 tiff2ps-PS2.sh \ 86 tiff2ps-PS3.sh \ 87 tiff2ps-EPS1.sh \ 88 tiff2pdf.sh \ 89 tiffcrop-doubleflip-logluv-3c-16b.sh \ 90 tiffcrop-doubleflip-minisblack-1c-16b.sh \ 91 tiffcrop-doubleflip-minisblack-1c-8b.sh \ 92 tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \ 93 tiffcrop-doubleflip-miniswhite-1c-1b.sh \ 94 tiffcrop-doubleflip-palette-1c-1b.sh \ 95 tiffcrop-doubleflip-palette-1c-4b.sh \ 96 tiffcrop-doubleflip-palette-1c-8b.sh \ 97 tiffcrop-doubleflip-rgb-3c-16b.sh \ 98 tiffcrop-doubleflip-rgb-3c-8b.sh \ 99 tiffcrop-extract-logluv-3c-16b.sh \ 100 tiffcrop-extract-minisblack-1c-16b.sh \ 101 tiffcrop-extract-minisblack-1c-8b.sh \ 102 tiffcrop-extract-minisblack-2c-8b-alpha.sh \ 103 tiffcrop-extract-miniswhite-1c-1b.sh \ 104 tiffcrop-extract-palette-1c-1b.sh \ 105 tiffcrop-extract-palette-1c-4b.sh \ 106 tiffcrop-extract-palette-1c-8b.sh \ 107 tiffcrop-extract-rgb-3c-16b.sh \ 108 tiffcrop-extract-rgb-3c-8b.sh \ 109 tiffcrop-extractz14-logluv-3c-16b.sh \ 110 tiffcrop-extractz14-minisblack-1c-16b.sh \ 111 tiffcrop-extractz14-minisblack-1c-8b.sh \ 112 tiffcrop-extractz14-minisblack-2c-8b-alpha.sh \ 113 tiffcrop-extractz14-miniswhite-1c-1b.sh \ 114 tiffcrop-extractz14-palette-1c-1b.sh \ 115 tiffcrop-extractz14-palette-1c-4b.sh \ 116 tiffcrop-extractz14-palette-1c-8b.sh \ 117 tiffcrop-extractz14-rgb-3c-16b.sh \ 118 tiffcrop-extractz14-rgb-3c-8b.sh \ 119 tiffcrop-R90-logluv-3c-16b.sh \ 120 tiffcrop-R90-minisblack-1c-16b.sh \ 121 tiffcrop-R90-minisblack-1c-8b.sh \ 122 tiffcrop-R90-minisblack-2c-8b-alpha.sh \ 123 tiffcrop-R90-miniswhite-1c-1b.sh \ 124 tiffcrop-R90-palette-1c-1b.sh \ 125 tiffcrop-R90-palette-1c-4b.sh \ 126 tiffcrop-R90-palette-1c-8b.sh \ 127 tiffcrop-R90-rgb-3c-16b.sh \ 128 tiffcrop-R90-rgb-3c-8b.sh \ 129 tiff2rgba-logluv-3c-16b.sh \ 130 tiff2rgba-minisblack-1c-16b.sh \ 131 tiff2rgba-minisblack-1c-8b.sh \ 132 tiff2rgba-minisblack-2c-8b-alpha.sh \ 133 tiff2rgba-miniswhite-1c-1b.sh \ 134 tiff2rgba-palette-1c-1b.sh \ 135 tiff2rgba-palette-1c-4b.sh \ 136 tiff2rgba-palette-1c-8b.sh \ 137 tiff2rgba-rgb-3c-16b.sh \ 138 tiff2rgba-rgb-3c-8b.sh \ 139 $(JPEG_DEPENDENT_TESTSCRIPTS) 140 141# This list should contain all of the TIFF files in the 'images' 142# subdirectory which are intended to be used as input images for 143# tests. All of these files should use the extension ".tiff". 144TIFFIMAGES = \ 145 images/logluv-3c-16b.tiff \ 146 images/minisblack-1c-16b.tiff \ 147 images/minisblack-1c-8b.tiff \ 148 images/minisblack-2c-8b-alpha.tiff \ 149 images/miniswhite-1c-1b.tiff \ 150 images/palette-1c-1b.tiff \ 151 images/palette-1c-4b.tiff \ 152 images/palette-1c-8b.tiff \ 153 images/rgb-3c-16b.tiff \ 154 images/rgb-3c-8b.tiff \ 155 images/quad-tile.jpg.tiff 156 157PNMIMAGES = \ 158 images/minisblack-1c-8b.pgm \ 159 images/miniswhite-1c-1b.pbm \ 160 images/rgb-3c-8b.ppm 161 162# This list should include all of the files in the 'images' 163# subdirectory which are intended to be distributed. This may include 164# files which are not currently used by the tests. 165IMAGES_EXTRA_DIST = \ 166 images/README.txt \ 167 $(PNMIMAGES) \ 168 $(TIFFIMAGES) 169 170noinst_HEADERS = tifftest.h 171 172ascii_tag_SOURCES = ascii_tag.c 173ascii_tag_LDADD = $(LIBTIFF) 174long_tag_SOURCES = long_tag.c check_tag.c 175long_tag_LDADD = $(LIBTIFF) 176short_tag_SOURCES = short_tag.c check_tag.c 177short_tag_LDADD = $(LIBTIFF) 178strip_rw_SOURCES = strip_rw.c strip.c test_arrays.c test_arrays.h 179strip_rw_LDADD = $(LIBTIFF) 180rewrite_SOURCES = rewrite_tag.c 181rewrite_LDADD = $(LIBTIFF) 182raw_decode_SOURCES = raw_decode.c 183raw_decode_LDADD = $(LIBTIFF) 184custom_dir_SOURCES = custom_dir.c 185custom_dir_LDADD = $(LIBTIFF) 186 187AM_CPPFLAGS = -I$(top_srcdir)/libtiff 188 189# memcheck: valgrind's memory access checker. 190# 191# The suppressions which come with valgrind are sometimes insufficient 192# to handle certain system library aspects which may be reported and 193# which are unrelated to libtiff. When first starting with a new 194# system (or after a major system update), it is good to execute the 195# test suite (known to already be passing!) like 'make memcheck 196# VALGRIND_EXTRA_OPTS=--gen-suppressions=all' to create valgrind 197# suppression entries in the test log. Make sure that none of the 198# suppressions are due to libtiff itself. Tell valgrind about the 199# suppressions by creating a .valgrindrc file with content like: 200# --memcheck:suppressions=mysupp.supp 201memcheck: 202 $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes \ 203 --error-exitcode=2 --track-origins=yes --num-callers=12 \ 204 --quiet $(VALGRIND_EXTRA_OPTS)' check 205 206# ptrcheck: valgrind's experimental pointer checking tool. 207ptrcheck: 208 $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check 209 210generate-tiff2rgba-tests: 211 for file in $(TIFFIMAGES) ; \ 212 do \ 213 base=`basename $$file .tiff` ; \ 214 testscript=$(srcdir)/tiff2rgba-$$base.sh ; \ 215 ( \ 216 echo "#!/bin/sh" ; \ 217 echo "# Generated file, master is Makefile.am" ; \ 218 echo ". \$${srcdir:-.}/common.sh" ; \ 219 echo "infile=\"\$$srcdir/$$file\"" ; \ 220 echo "outfile=\"o-tiff2rgba-$$base.tiff\"" ; \ 221 echo "f_test_convert \"\$$TIFF2RGBA\" \$$infile \$$outfile" ; \ 222 echo "f_tiffinfo_validate \$$outfile" ; \ 223 ) > $$testscript ; \ 224 chmod +x $$testscript ; \ 225 done 226 227# Test rotations 228generate-tiffcrop-R90-tests: 229 for file in $(TIFFIMAGES) ; \ 230 do \ 231 base=`basename $$file .tiff` ; \ 232 testscript=$(srcdir)/tiffcrop-R90-$$base.sh ; \ 233 ( \ 234 echo "#!/bin/sh" ; \ 235 echo "# Generated file, master is Makefile.am" ; \ 236 echo ". \$${srcdir:-.}/common.sh" ; \ 237 echo "infile=\"\$$srcdir/$$file\"" ; \ 238 echo "outfile=\"o-tiffcrop-R90-$$base.tiff\"" ; \ 239 echo "f_test_convert \"\$$TIFFCROP -R90\" \$$infile \$$outfile" ; \ 240 echo "f_tiffinfo_validate \$$outfile" ; \ 241 ) > $$testscript ; \ 242 chmod +x $$testscript ; \ 243 done 244 245# Test flip (mirror) 246generate-tiffcrop-doubleflip-tests: 247 for file in $(TIFFIMAGES) ; \ 248 do \ 249 base=`basename $$file .tiff` ; \ 250 testscript=$(srcdir)/tiffcrop-doubleflip-$$base.sh ; \ 251 ( \ 252 echo "#!/bin/sh" ; \ 253 echo "# Generated file, master is Makefile.am" ; \ 254 echo ". \$${srcdir:-.}/common.sh" ; \ 255 echo "infile=\"\$$srcdir/$$file\"" ; \ 256 echo "outfile=\"o-tiffcrop-doubleflip-$$base.tiff\"" ; \ 257 echo "f_test_convert \"\$$TIFFCROP -F both\" \$$infile \$$outfile" ; \ 258 echo "f_tiffinfo_validate \$$outfile" ; \ 259 ) > $$testscript ; \ 260 chmod +x $$testscript ; \ 261 done 262 263# Test extracting a section 100 pixels wide and 100 pixels high 264generate-tiffcrop-extract-tests: 265 for file in $(TIFFIMAGES) ; \ 266 do \ 267 base=`basename $$file .tiff` ; \ 268 testscript=$(srcdir)/tiffcrop-extract-$$base.sh ; \ 269 ( \ 270 echo "#!/bin/sh" ; \ 271 echo "# Generated file, master is Makefile.am" ; \ 272 echo ". \$${srcdir:-.}/common.sh" ; \ 273 echo "infile=\"\$$srcdir/$$file\"" ; \ 274 echo "outfile=\"o-tiffcrop-extract-$$base.tiff\"" ; \ 275 echo "f_test_convert \"\$$TIFFCROP -U px -E top -X 60 -Y 60\" \$$infile \$$outfile" ; \ 276 echo "f_tiffinfo_validate \$$outfile" ; \ 277 ) > $$testscript ; \ 278 chmod +x $$testscript ; \ 279 done 280 281# Test extracting the first and fourth quarters from the left side. 282generate-tiffcrop-extractz14-tests: 283 for file in $(TIFFIMAGES) ; \ 284 do \ 285 base=`basename $$file .tiff` ; \ 286 testscript=$(srcdir)/tiffcrop-extractz14-$$base.sh ; \ 287 ( \ 288 echo "#!/bin/sh" ; \ 289 echo "# Generated file, master is Makefile.am" ; \ 290 echo ". \$${srcdir:-.}/common.sh" ; \ 291 echo "infile=\"\$$srcdir/$$file\"" ; \ 292 echo "outfile=\"o-tiffcrop-extractz14-$$base.tiff\"" ; \ 293 echo "f_test_convert \"\$$TIFFCROP -E left -Z1:4,2:4\" \$$infile \$$outfile" ; \ 294 echo "f_tiffinfo_validate \$$outfile" ; \ 295 ) > $$testscript ; \ 296 chmod +x $$testscript ; \ 297 done 298 299generate-tiffcrop-tests: \ 300 generate-tiffcrop-R90-tests \ 301 generate-tiffcrop-doubleflip-tests \ 302 generate-tiffcrop-extract-tests \ 303 generate-tiffcrop-extractz14-tests 304 305generate-tests: \ 306 generate-tiff2rgba-tests \ 307 generate-tiffcrop-tests 308