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.11 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 common.sh 40 41# All of the tests to execute via 'make check' 42TESTS = $(check_PROGRAMS) $(TESTSCRIPTS) 43 44# Tests which are expected to fail 45XFAIL_TESTS = 46 47# Extra files which should be cleaned by 'make clean' 48CLEANFILES = test_packbits.tif o-* 49 50# Executable programs which need to be built in order to support tests 51check_PROGRAMS = ascii_tag long_tag short_tag strip_rw rewrite raw_decode 52 53# Test scripts to execute 54TESTSCRIPTS = \ 55 bmp2tiff_palette.sh \ 56 bmp2tiff_rgb.sh \ 57 gif2tiff.sh \ 58 ppm2tiff_pbm.sh \ 59 ppm2tiff_pgm.sh \ 60 ppm2tiff_ppm.sh \ 61 tiffcp-g3.sh \ 62 tiffcp-g3-1d.sh \ 63 tiffcp-g3-1d-fill.sh \ 64 tiffcp-g3-2d.sh \ 65 tiffcp-g3-2d-fill.sh \ 66 tiffcp-g4.sh \ 67 tiffcp-logluv.sh \ 68 tiffcp-thumbnail.sh \ 69 tiffdump.sh \ 70 tiffinfo.sh \ 71 tiffcp-split.sh \ 72 tiffcp-split-join.sh \ 73 tiff2ps-PS1.sh \ 74 tiff2ps-PS2.sh \ 75 tiff2ps-PS3.sh \ 76 tiff2ps-EPS1.sh \ 77 tiff2pdf.sh \ 78 tiffcrop-doubleflip-logluv-3c-16b.sh \ 79 tiffcrop-doubleflip-minisblack-1c-16b.sh \ 80 tiffcrop-doubleflip-minisblack-1c-8b.sh \ 81 tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \ 82 tiffcrop-doubleflip-miniswhite-1c-1b.sh \ 83 tiffcrop-doubleflip-palette-1c-1b.sh \ 84 tiffcrop-doubleflip-palette-1c-4b.sh \ 85 tiffcrop-doubleflip-palette-1c-8b.sh \ 86 tiffcrop-doubleflip-rgb-3c-16b.sh \ 87 tiffcrop-doubleflip-rgb-3c-8b.sh \ 88 tiffcrop-extract-logluv-3c-16b.sh \ 89 tiffcrop-extract-minisblack-1c-16b.sh \ 90 tiffcrop-extract-minisblack-1c-8b.sh \ 91 tiffcrop-extract-minisblack-2c-8b-alpha.sh \ 92 tiffcrop-extract-miniswhite-1c-1b.sh \ 93 tiffcrop-extract-palette-1c-1b.sh \ 94 tiffcrop-extract-palette-1c-4b.sh \ 95 tiffcrop-extract-palette-1c-8b.sh \ 96 tiffcrop-extract-rgb-3c-16b.sh \ 97 tiffcrop-extract-rgb-3c-8b.sh \ 98 tiffcrop-extractz14-logluv-3c-16b.sh \ 99 tiffcrop-extractz14-minisblack-1c-16b.sh \ 100 tiffcrop-extractz14-minisblack-1c-8b.sh \ 101 tiffcrop-extractz14-minisblack-2c-8b-alpha.sh \ 102 tiffcrop-extractz14-miniswhite-1c-1b.sh \ 103 tiffcrop-extractz14-palette-1c-1b.sh \ 104 tiffcrop-extractz14-palette-1c-4b.sh \ 105 tiffcrop-extractz14-palette-1c-8b.sh \ 106 tiffcrop-extractz14-rgb-3c-16b.sh \ 107 tiffcrop-extractz14-rgb-3c-8b.sh \ 108 tiffcrop-R90-logluv-3c-16b.sh \ 109 tiffcrop-R90-minisblack-1c-16b.sh \ 110 tiffcrop-R90-minisblack-1c-8b.sh \ 111 tiffcrop-R90-minisblack-2c-8b-alpha.sh \ 112 tiffcrop-R90-miniswhite-1c-1b.sh \ 113 tiffcrop-R90-palette-1c-1b.sh \ 114 tiffcrop-R90-palette-1c-4b.sh \ 115 tiffcrop-R90-palette-1c-8b.sh \ 116 tiffcrop-R90-rgb-3c-16b.sh \ 117 tiffcrop-R90-rgb-3c-8b.sh \ 118 tiff2rgba-logluv-3c-16b.sh \ 119 tiff2rgba-minisblack-1c-16b.sh \ 120 tiff2rgba-minisblack-1c-8b.sh \ 121 tiff2rgba-minisblack-2c-8b-alpha.sh \ 122 tiff2rgba-miniswhite-1c-1b.sh \ 123 tiff2rgba-palette-1c-1b.sh \ 124 tiff2rgba-palette-1c-4b.sh \ 125 tiff2rgba-palette-1c-8b.sh \ 126 tiff2rgba-rgb-3c-16b.sh \ 127 tiff2rgba-rgb-3c-8b.sh \ 128 tiff2rgba-quad-tile.jpg.sh 129 130# This list should contain all of the TIFF files in the 'images' 131# subdirectory which are intended to be used as input images for 132# tests. All of these files should use the extension ".tiff". 133TIFFIMAGES = \ 134 images/logluv-3c-16b.tiff \ 135 images/minisblack-1c-16b.tiff \ 136 images/minisblack-1c-8b.tiff \ 137 images/minisblack-2c-8b-alpha.tiff \ 138 images/miniswhite-1c-1b.tiff \ 139 images/palette-1c-1b.tiff \ 140 images/palette-1c-4b.tiff \ 141 images/palette-1c-8b.tiff \ 142 images/rgb-3c-16b.tiff \ 143 images/rgb-3c-8b.tiff \ 144 images/quad-tile.jpg.tiff 145 146BMPIMAGES = \ 147 images/palette-1c-8b.bmp \ 148 images/rgb-3c-8b.bmp 149 150GIFIMAGES = \ 151 images/palette-1c-8b.gif 152 153PNMIMAGES = \ 154 images/minisblack-1c-8b.pgm \ 155 images/miniswhite-1c-1b.pbm \ 156 images/rgb-3c-8b.ppm 157 158# This list should include all of the files in the 'images' 159# subdirectory which are intended to be distributed. This may include 160# files which are not currently used by the tests. 161IMAGES_EXTRA_DIST = \ 162 images/README.txt \ 163 $(BMPIMAGES) \ 164 $(GIFIMAGES) \ 165 $(PNMIMAGES) \ 166 $(TIFFIMAGES) 167 168noinst_HEADERS = tifftest.h 169 170ascii_tag_SOURCES = ascii_tag.c 171ascii_tag_LDADD = $(LIBTIFF) 172long_tag_SOURCES = long_tag.c check_tag.c 173long_tag_LDADD = $(LIBTIFF) 174short_tag_SOURCES = short_tag.c check_tag.c 175short_tag_LDADD = $(LIBTIFF) 176strip_rw_SOURCES = strip_rw.c strip.c test_arrays.c test_arrays.h 177strip_rw_LDADD = $(LIBTIFF) 178rewrite_SOURCES = rewrite_tag.c 179rewrite_LDADD = $(LIBTIFF) 180raw_decode_SOURCES = raw_decode.c 181raw_decode_LDADD = $(LIBTIFF) 182 183INCLUDES = -I$(top_srcdir)/libtiff 184 185# memcheck: valgrind's memory access checker 186memcheck: 187 $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes --track-origins=yes --num-callers=12 --quiet $(VALGRIND_EXTRA_OPTS)' check 188 189# ptrcheck: valgrind's experimental pointer checking tool. 190ptrcheck: 191 $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check 192 193generate-tiff2rgba-tests: 194 for file in $(TIFFIMAGES) ; \ 195 do \ 196 base=`basename $$file .tiff` ; \ 197 testscript=$(srcdir)/tiff2rgba-$$base.sh ; \ 198 ( \ 199 echo "#!/bin/sh" ; \ 200 echo "# Generated file, master is Makefile.am" ; \ 201 echo ". \$${srcdir:-.}/common.sh" ; \ 202 echo "infile=\"\$$srcdir/$$file\"" ; \ 203 echo "outfile=\"o-tiff2rgba-$$base.tiff\"" ; \ 204 echo "f_test_convert \"\$$TIFF2RGBA\" \$$infile \$$outfile" ; \ 205 echo "f_tiffinfo_validate \$$outfile" ; \ 206 ) > $$testscript ; \ 207 chmod +x $$testscript ; \ 208 done 209 210# Test rotations 211generate-tiffcrop-R90-tests: 212 for file in $(TIFFIMAGES) ; \ 213 do \ 214 base=`basename $$file .tiff` ; \ 215 testscript=$(srcdir)/tiffcrop-R90-$$base.sh ; \ 216 ( \ 217 echo "#!/bin/sh" ; \ 218 echo "# Generated file, master is Makefile.am" ; \ 219 echo ". \$${srcdir:-.}/common.sh" ; \ 220 echo "infile=\"\$$srcdir/$$file\"" ; \ 221 echo "outfile=\"o-tiffcrop-R90-$$base.tiff\"" ; \ 222 echo "f_test_convert \"\$$TIFFCROP -R90\" \$$infile \$$outfile" ; \ 223 echo "f_tiffinfo_validate \$$outfile" ; \ 224 ) > $$testscript ; \ 225 chmod +x $$testscript ; \ 226 done 227 228# Test flip (mirror) 229generate-tiffcrop-doubleflip-tests: 230 for file in $(TIFFIMAGES) ; \ 231 do \ 232 base=`basename $$file .tiff` ; \ 233 testscript=$(srcdir)/tiffcrop-doubleflip-$$base.sh ; \ 234 ( \ 235 echo "#!/bin/sh" ; \ 236 echo "# Generated file, master is Makefile.am" ; \ 237 echo ". \$${srcdir:-.}/common.sh" ; \ 238 echo "infile=\"\$$srcdir/$$file\"" ; \ 239 echo "outfile=\"o-tiffcrop-doubleflip-$$base.tiff\"" ; \ 240 echo "f_test_convert \"\$$TIFFCROP -F both\" \$$infile \$$outfile" ; \ 241 echo "f_tiffinfo_validate \$$outfile" ; \ 242 ) > $$testscript ; \ 243 chmod +x $$testscript ; \ 244 done 245 246# Test extracting a section 100 pixels wide and 100 pixels high 247generate-tiffcrop-extract-tests: 248 for file in $(TIFFIMAGES) ; \ 249 do \ 250 base=`basename $$file .tiff` ; \ 251 testscript=$(srcdir)/tiffcrop-extract-$$base.sh ; \ 252 ( \ 253 echo "#!/bin/sh" ; \ 254 echo "# Generated file, master is Makefile.am" ; \ 255 echo ". \$${srcdir:-.}/common.sh" ; \ 256 echo "infile=\"\$$srcdir/$$file\"" ; \ 257 echo "outfile=\"o-tiffcrop-extract-$$base.tiff\"" ; \ 258 echo "f_test_convert \"\$$TIFFCROP -U px -E top -X 60 -Y 60\" \$$infile \$$outfile" ; \ 259 echo "f_tiffinfo_validate \$$outfile" ; \ 260 ) > $$testscript ; \ 261 chmod +x $$testscript ; \ 262 done 263 264# Test extracting the first and fourth quarters from the left side. 265generate-tiffcrop-extractz14-tests: 266 for file in $(TIFFIMAGES) ; \ 267 do \ 268 base=`basename $$file .tiff` ; \ 269 testscript=$(srcdir)/tiffcrop-extractz14-$$base.sh ; \ 270 ( \ 271 echo "#!/bin/sh" ; \ 272 echo "# Generated file, master is Makefile.am" ; \ 273 echo ". \$${srcdir:-.}/common.sh" ; \ 274 echo "infile=\"\$$srcdir/$$file\"" ; \ 275 echo "outfile=\"o-tiffcrop-extractz14-$$base.tiff\"" ; \ 276 echo "f_test_convert \"\$$TIFFCROP -E left -Z1:4,2:4\" \$$infile \$$outfile" ; \ 277 echo "f_tiffinfo_validate \$$outfile" ; \ 278 ) > $$testscript ; \ 279 chmod +x $$testscript ; \ 280 done 281 282generate-tiffcrop-tests: \ 283 generate-tiffcrop-R90-tests \ 284 generate-tiffcrop-doubleflip-tests \ 285 generate-tiffcrop-extract-tests \ 286 generate-tiffcrop-extractz14-tests 287 288generate-tests: \ 289 generate-tiff2rgba-tests \ 290 generate-tiffcrop-tests 291