1 # Tag Image File Format (TIFF) Software
3 # Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
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.
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.
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
24 # Process this file with automake to produce Makefile.in.
26 AUTOMAKE_OPTIONS = 1.12 color-tests parallel-tests foreign
28 LIBTIFF = $(top_builddir)/libtiff/libtiff.la
30 # Environment parameters to be used during tests
33 MAKEFLAGS="$(MAKEFLAGS)" \
34 MEMCHECK="$(MEMCHECK)"
38 $(IMAGES_EXTRA_DIST) \
42 TiffTestCommon.cmake \
45 # All of the tests to execute via 'make check'
46 TESTS = $(check_PROGRAMS) $(TESTSCRIPTS)
48 # Tests which are expected to fail
51 # Extra files which should be cleaned by 'make clean'
52 CLEANFILES = test_packbits.tif o-*
55 JPEG_DEPENDENT_CHECK_PROG=raw_decode
56 JPEG_DEPENDENT_TESTSCRIPTS=\
57 tiff2rgba-quad-tile.jpg.sh
59 JPEG_DEPENDENT_CHECK_PROG=
60 JPEG_DEPENDENT_TESTSCRIPTS=
63 # Executable programs which need to be built in order to support tests
65 ascii_tag long_tag short_tag strip_rw rewrite custom_dir \
66 $(JPEG_DEPENDENT_CHECK_PROG)
68 # Test scripts to execute
75 tiffcp-g3-1d-fill.sh \
77 tiffcp-g3-2d-fill.sh \
81 tiffcp-lzw-compat.sh \
85 tiffcp-split-join.sh \
91 tiffcrop-doubleflip-logluv-3c-16b.sh \
92 tiffcrop-doubleflip-minisblack-1c-16b.sh \
93 tiffcrop-doubleflip-minisblack-1c-8b.sh \
94 tiffcrop-doubleflip-minisblack-2c-8b-alpha.sh \
95 tiffcrop-doubleflip-miniswhite-1c-1b.sh \
96 tiffcrop-doubleflip-palette-1c-1b.sh \
97 tiffcrop-doubleflip-palette-1c-4b.sh \
98 tiffcrop-doubleflip-palette-1c-8b.sh \
99 tiffcrop-doubleflip-rgb-3c-16b.sh \
100 tiffcrop-doubleflip-rgb-3c-8b.sh \
101 tiffcrop-extract-logluv-3c-16b.sh \
102 tiffcrop-extract-minisblack-1c-16b.sh \
103 tiffcrop-extract-minisblack-1c-8b.sh \
104 tiffcrop-extract-minisblack-2c-8b-alpha.sh \
105 tiffcrop-extract-miniswhite-1c-1b.sh \
106 tiffcrop-extract-palette-1c-1b.sh \
107 tiffcrop-extract-palette-1c-4b.sh \
108 tiffcrop-extract-palette-1c-8b.sh \
109 tiffcrop-extract-rgb-3c-16b.sh \
110 tiffcrop-extract-rgb-3c-8b.sh \
111 tiffcrop-extractz14-logluv-3c-16b.sh \
112 tiffcrop-extractz14-minisblack-1c-16b.sh \
113 tiffcrop-extractz14-minisblack-1c-8b.sh \
114 tiffcrop-extractz14-minisblack-2c-8b-alpha.sh \
115 tiffcrop-extractz14-miniswhite-1c-1b.sh \
116 tiffcrop-extractz14-palette-1c-1b.sh \
117 tiffcrop-extractz14-palette-1c-4b.sh \
118 tiffcrop-extractz14-palette-1c-8b.sh \
119 tiffcrop-extractz14-rgb-3c-16b.sh \
120 tiffcrop-extractz14-rgb-3c-8b.sh \
121 tiffcrop-R90-logluv-3c-16b.sh \
122 tiffcrop-R90-minisblack-1c-16b.sh \
123 tiffcrop-R90-minisblack-1c-8b.sh \
124 tiffcrop-R90-minisblack-2c-8b-alpha.sh \
125 tiffcrop-R90-miniswhite-1c-1b.sh \
126 tiffcrop-R90-palette-1c-1b.sh \
127 tiffcrop-R90-palette-1c-4b.sh \
128 tiffcrop-R90-palette-1c-8b.sh \
129 tiffcrop-R90-rgb-3c-16b.sh \
130 tiffcrop-R90-rgb-3c-8b.sh \
131 tiff2bw-palette-1c-8b.sh \
132 tiff2bw-quad-lzw-compat.sh \
133 tiff2bw-rgb-3c-8b.sh \
134 tiff2rgba-logluv-3c-16b.sh \
135 tiff2rgba-minisblack-1c-16b.sh \
136 tiff2rgba-minisblack-1c-8b.sh \
137 tiff2rgba-minisblack-2c-8b-alpha.sh \
138 tiff2rgba-miniswhite-1c-1b.sh \
139 tiff2rgba-palette-1c-1b.sh \
140 tiff2rgba-palette-1c-4b.sh \
141 tiff2rgba-palette-1c-8b.sh \
142 tiff2rgba-rgb-3c-16b.sh \
143 tiff2rgba-rgb-3c-8b.sh \
144 $(JPEG_DEPENDENT_TESTSCRIPTS)
146 # This list should contain all of the TIFF files in the 'images'
147 # subdirectory which are intended to be used as input images for
148 # tests. All of these files should use the extension ".tiff".
150 images/logluv-3c-16b.tiff \
151 images/minisblack-1c-16b.tiff \
152 images/minisblack-1c-8b.tiff \
153 images/minisblack-2c-8b-alpha.tiff \
154 images/miniswhite-1c-1b.tiff \
155 images/palette-1c-1b.tiff \
156 images/palette-1c-4b.tiff \
157 images/palette-1c-8b.tiff \
158 images/rgb-3c-16b.tiff \
159 images/rgb-3c-8b.tiff \
160 images/quad-tile.jpg.tiff \
161 images/quad-lzw-compat.tiff
164 images/minisblack-1c-8b.pgm \
165 images/miniswhite-1c-1b.pbm \
168 # This list should include all of the files in the 'images'
169 # subdirectory which are intended to be distributed. This may include
170 # files which are not currently used by the tests.
171 IMAGES_EXTRA_DIST = \
176 noinst_HEADERS = tifftest.h
178 ascii_tag_SOURCES = ascii_tag.c
179 ascii_tag_LDADD = $(LIBTIFF)
180 long_tag_SOURCES = long_tag.c check_tag.c
181 long_tag_LDADD = $(LIBTIFF)
182 short_tag_SOURCES = short_tag.c check_tag.c
183 short_tag_LDADD = $(LIBTIFF)
184 strip_rw_SOURCES = strip_rw.c strip.c test_arrays.c test_arrays.h
185 strip_rw_LDADD = $(LIBTIFF)
186 rewrite_SOURCES = rewrite_tag.c
187 rewrite_LDADD = $(LIBTIFF)
188 raw_decode_SOURCES = raw_decode.c
189 raw_decode_LDADD = $(LIBTIFF)
190 custom_dir_SOURCES = custom_dir.c
191 custom_dir_LDADD = $(LIBTIFF)
193 AM_CPPFLAGS = -I$(top_srcdir)/libtiff
195 # memcheck: valgrind's memory access checker.
197 # The suppressions which come with valgrind are sometimes insufficient
198 # to handle certain system library aspects which may be reported and
199 # which are unrelated to libtiff. When first starting with a new
200 # system (or after a major system update), it is good to execute the
201 # test suite (known to already be passing!) like 'make memcheck
202 # VALGRIND_EXTRA_OPTS=--gen-suppressions=all' to create valgrind
203 # suppression entries in the test log. Make sure that none of the
204 # suppressions are due to libtiff itself. Tell valgrind about the
205 # suppressions by creating a .valgrindrc file with content like:
206 # --memcheck:suppressions=mysupp.supp
208 $(MAKE) MEMCHECK='valgrind --tool=memcheck --leak-check=full --read-var-info=yes \
209 --error-exitcode=2 --track-origins=yes --num-callers=12 \
210 --quiet $(VALGRIND_EXTRA_OPTS)' check
212 # ptrcheck: valgrind's experimental pointer checking tool.
214 $(MAKE) MEMCHECK='valgrind --tool=exp-ptrcheck --quiet $(VALGRIND_EXTRA_OPTS)' check
216 # tiff2bw is pretty lame so currently only the generated scripts
217 # tiff2bw-palette-1c-8b.sh, tiff2bw-quad-lzw-compat.sh, and
218 # tiff2bw-rgb-3c-8b.sh pass tests.
219 generate-tiff2bw-tests:
220 for file in $(TIFFIMAGES) ; \
222 base=`basename $$file .tiff` ; \
223 testscript=$(srcdir)/tiff2bw-$$base.sh ; \
226 echo "# Generated file, master is Makefile.am" ; \
227 echo ". \$${srcdir:-.}/common.sh" ; \
228 echo "infile=\"\$$srcdir/$$file\"" ; \
229 echo "outfile=\"o-tiff2bw-$$base.tiff\"" ; \
230 echo "f_test_convert \"\$$TIFF2BW\" \$$infile \$$outfile" ; \
231 echo "f_tiffinfo_validate \$$outfile" ; \
233 chmod +x $$testscript ; \
236 generate-tiff2rgba-tests:
237 for file in $(TIFFIMAGES) ; \
239 base=`basename $$file .tiff` ; \
240 testscript=$(srcdir)/tiff2rgba-$$base.sh ; \
243 echo "# Generated file, master is Makefile.am" ; \
244 echo ". \$${srcdir:-.}/common.sh" ; \
245 echo "infile=\"\$$srcdir/$$file\"" ; \
246 echo "outfile=\"o-tiff2rgba-$$base.tiff\"" ; \
247 echo "f_test_convert \"\$$TIFF2RGBA\" \$$infile \$$outfile" ; \
248 echo "f_tiffinfo_validate \$$outfile" ; \
250 chmod +x $$testscript ; \
254 generate-tiffcrop-R90-tests:
255 for file in $(TIFFIMAGES) ; \
257 base=`basename $$file .tiff` ; \
258 testscript=$(srcdir)/tiffcrop-R90-$$base.sh ; \
261 echo "# Generated file, master is Makefile.am" ; \
262 echo ". \$${srcdir:-.}/common.sh" ; \
263 echo "infile=\"\$$srcdir/$$file\"" ; \
264 echo "outfile=\"o-tiffcrop-R90-$$base.tiff\"" ; \
265 echo "f_test_convert \"\$$TIFFCROP -R90\" \$$infile \$$outfile" ; \
266 echo "f_tiffinfo_validate \$$outfile" ; \
268 chmod +x $$testscript ; \
272 generate-tiffcrop-doubleflip-tests:
273 for file in $(TIFFIMAGES) ; \
275 base=`basename $$file .tiff` ; \
276 testscript=$(srcdir)/tiffcrop-doubleflip-$$base.sh ; \
279 echo "# Generated file, master is Makefile.am" ; \
280 echo ". \$${srcdir:-.}/common.sh" ; \
281 echo "infile=\"\$$srcdir/$$file\"" ; \
282 echo "outfile=\"o-tiffcrop-doubleflip-$$base.tiff\"" ; \
283 echo "f_test_convert \"\$$TIFFCROP -F both\" \$$infile \$$outfile" ; \
284 echo "f_tiffinfo_validate \$$outfile" ; \
286 chmod +x $$testscript ; \
289 # Test extracting a section 100 pixels wide and 100 pixels high
290 generate-tiffcrop-extract-tests:
291 for file in $(TIFFIMAGES) ; \
293 base=`basename $$file .tiff` ; \
294 testscript=$(srcdir)/tiffcrop-extract-$$base.sh ; \
297 echo "# Generated file, master is Makefile.am" ; \
298 echo ". \$${srcdir:-.}/common.sh" ; \
299 echo "infile=\"\$$srcdir/$$file\"" ; \
300 echo "outfile=\"o-tiffcrop-extract-$$base.tiff\"" ; \
301 echo "f_test_convert \"\$$TIFFCROP -U px -E top -X 60 -Y 60\" \$$infile \$$outfile" ; \
302 echo "f_tiffinfo_validate \$$outfile" ; \
304 chmod +x $$testscript ; \
307 # Test extracting the first and fourth quarters from the left side.
308 generate-tiffcrop-extractz14-tests:
309 for file in $(TIFFIMAGES) ; \
311 base=`basename $$file .tiff` ; \
312 testscript=$(srcdir)/tiffcrop-extractz14-$$base.sh ; \
315 echo "# Generated file, master is Makefile.am" ; \
316 echo ". \$${srcdir:-.}/common.sh" ; \
317 echo "infile=\"\$$srcdir/$$file\"" ; \
318 echo "outfile=\"o-tiffcrop-extractz14-$$base.tiff\"" ; \
319 echo "f_test_convert \"\$$TIFFCROP -E left -Z1:4,2:4\" \$$infile \$$outfile" ; \
320 echo "f_tiffinfo_validate \$$outfile" ; \
322 chmod +x $$testscript ; \
325 generate-tiffcrop-tests: \
326 generate-tiffcrop-R90-tests \
327 generate-tiffcrop-doubleflip-tests \
328 generate-tiffcrop-extract-tests \
329 generate-tiffcrop-extractz14-tests
332 generate-tiff2bw-tests \
333 generate-tiff2rgba-tests \
334 generate-tiffcrop-tests