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