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