ascii: Add support for multibyte characters.
[pspp-builds.git] / tests / automake.mk
1 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
2
3 check_PROGRAMS += \
4         tests/data/datasheet-test \
5         tests/data/sack \
6         tests/data/inexactify \
7         tests/language/lexer/command-name-test \
8         tests/language/lexer/scan-test \
9         tests/language/lexer/segment-test \
10         tests/libpspp/abt-test \
11         tests/libpspp/bt-test \
12         tests/libpspp/encoding-guesser-test \
13         tests/libpspp/heap-test \
14         tests/libpspp/hmap-test \
15         tests/libpspp/hmapx-test \
16         tests/libpspp/i18n-test \
17         tests/libpspp/ll-test \
18         tests/libpspp/llx-test \
19         tests/libpspp/range-map-test \
20         tests/libpspp/range-set-test \
21         tests/libpspp/sparse-array-test \
22         tests/libpspp/sparse-xarray-test \
23         tests/libpspp/str-test \
24         tests/libpspp/string-map-test \
25         tests/libpspp/stringi-map-test \
26         tests/libpspp/string-set-test \
27         tests/libpspp/stringi-set-test \
28         tests/libpspp/tower-test \
29         tests/libpspp/u8-istream-test \
30         tests/output/render-test
31
32 check-programs: $(check_PROGRAMS)
33
34 tests_data_datasheet_test_SOURCES = \
35         tests/data/datasheet-test.c
36 tests_data_datasheet_test_LDADD = src/libpspp-core.la $(LIBINTL) 
37 tests_data_datasheet_test_CFLAGS = $(AM_CFLAGS)
38
39 tests_data_sack_SOURCES = \
40         tests/data/sack.c
41 tests_data_sack_LDADD = src/libpspp-core.la $(LIBINTL) 
42 tests_data_sack_CFLAGS = $(AM_CFLAGS)
43
44 tests_libpspp_ll_test_SOURCES = \
45         src/libpspp/ll.c \
46         tests/libpspp/ll-test.c
47 tests_libpspp_ll_test_LDADD = gl/libgl.la $(LIBINTL)
48 tests_libpspp_ll_test_CFLAGS = $(AM_CFLAGS)
49
50 tests_libpspp_llx_test_SOURCES = \
51         src/libpspp/ll.c \
52         src/libpspp/llx.c \
53         tests/libpspp/llx-test.c
54 tests_libpspp_llx_test_LDADD = gl/libgl.la $(LIBINTL)
55 tests_libpspp_llx_test_CFLAGS = $(AM_CFLAGS)
56
57 tests_libpspp_encoding_guesser_test_SOURCES = \
58         tests/libpspp/encoding-guesser-test.c
59 tests_libpspp_encoding_guesser_test_LDADD = src/libpspp/libpspp.la gl/libgl.la
60
61 tests_libpspp_heap_test_SOURCES = \
62         src/libpspp/heap.c \
63         src/libpspp/pool.c \
64         src/libpspp/temp-file.c \
65         tests/libpspp/heap-test.c
66 tests_libpspp_heap_test_LDADD = gl/libgl.la $(LIBINTL) 
67 tests_libpspp_heap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
68
69 tests_libpspp_hmap_test_SOURCES = \
70         src/libpspp/hmap.c \
71         tests/libpspp/hmap-test.c
72 tests_libpspp_hmap_test_LDADD = gl/libgl.la $(LIBINTL)
73 tests_libpspp_hmap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
74
75 tests_libpspp_hmapx_test_SOURCES = \
76         src/libpspp/hmap.c \
77         src/libpspp/hmapx.c \
78         tests/libpspp/hmapx-test.c
79 tests_libpspp_hmapx_test_LDADD = gl/libgl.la $(LIBINTL)
80 tests_libpspp_hmapx_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
81
82 tests_libpspp_i18n_test_SOURCES = tests/libpspp/i18n-test.c
83 tests_libpspp_i18n_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) 
84
85 tests_libpspp_abt_test_SOURCES = \
86         src/libpspp/abt.c \
87         tests/libpspp/abt-test.c
88 tests_libpspp_abt_test_LDADD = gl/libgl.la $(LIBINTL)
89 tests_libpspp_abt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
90
91 tests_libpspp_bt_test_SOURCES = \
92         src/libpspp/bt.c \
93         tests/libpspp/bt-test.c
94 tests_libpspp_bt_test_LDADD = gl/libgl.la
95 tests_libpspp_bt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
96
97 tests_libpspp_range_map_test_SOURCES = \
98         src/libpspp/bt.c \
99         src/libpspp/range-map.c \
100         tests/libpspp/range-map-test.c
101 tests_libpspp_range_map_test_LDADD = gl/libgl.la $(LIBINTL)
102 tests_libpspp_range_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
103
104 tests_libpspp_range_set_test_SOURCES = \
105         src/libpspp/bt.c \
106         src/libpspp/pool.c \
107         src/libpspp/range-set.c \
108         src/libpspp/temp-file.c \
109         tests/libpspp/range-set-test.c
110 tests_libpspp_range_set_test_LDADD = gl/libgl.la $(LIBINTL) 
111 tests_libpspp_range_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
112
113 tests_libpspp_str_test_SOURCES = \
114         tests/libpspp/str-test.c
115 tests_libpspp_str_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) 
116
117 tests_libpspp_string_map_test_SOURCES = \
118         src/libpspp/hash-functions.c \
119         src/libpspp/hmap.c \
120         src/libpspp/string-map.c \
121         src/libpspp/string-set.c \
122         tests/libpspp/string-map-test.c
123 tests_libpspp_string_map_test_LDADD = gl/libgl.la $(LIBINTL)
124 tests_libpspp_string_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
125
126 tests_libpspp_stringi_map_test_SOURCES = \
127         src/libpspp/hash-functions.c \
128         src/libpspp/hmap.c \
129         src/libpspp/pool.c \
130         src/libpspp/str.c \
131         src/libpspp/stringi-map.c \
132         src/libpspp/string-set.c \
133         src/libpspp/stringi-set.c \
134         src/libpspp/temp-file.c \
135         tests/libpspp/stringi-map-test.c
136 tests_libpspp_stringi_map_test_LDADD = gl/libgl.la $(LIBINTL)
137 tests_libpspp_stringi_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
138
139 tests_libpspp_string_set_test_SOURCES = \
140         src/libpspp/hash-functions.c \
141         src/libpspp/hmap.c \
142         src/libpspp/string-set.c \
143         tests/libpspp/string-set-test.c
144 tests_libpspp_string_set_test_LDADD = gl/libgl.la $(LIBINTL)
145 tests_libpspp_string_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
146
147 tests_libpspp_stringi_set_test_SOURCES = \
148         src/libpspp/hash-functions.c \
149         src/libpspp/hmap.c \
150         src/libpspp/pool.c \
151         src/libpspp/str.c \
152         src/libpspp/stringi-set.c \
153         src/libpspp/temp-file.c \
154         tests/libpspp/stringi-set-test.c
155 tests_libpspp_stringi_set_test_LDADD = gl/libgl.la $(LIBINTL)
156 tests_libpspp_stringi_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
157
158 tests_libpspp_tower_test_SOURCES = \
159         src/libpspp/abt.c \
160         src/libpspp/pool.c \
161         src/libpspp/temp-file.c \
162         src/libpspp/tower.c \
163         tests/libpspp/tower-test.c
164 tests_libpspp_tower_test_LDADD = gl/libgl.la $(LIBINTL) 
165 tests_libpspp_tower_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
166
167 tests_libpspp_u8_istream_test_SOURCES = tests/libpspp/u8-istream-test.c
168 tests_libpspp_u8_istream_test_LDADD = src/libpspp/libpspp.la gl/libgl.la
169
170 tests_libpspp_sparse_array_test_SOURCES = \
171         src/libpspp/sparse-array.c \
172         src/libpspp/pool.c \
173         tests/libpspp/sparse-array-test.c \
174         src/libpspp/temp-file.c
175 tests_libpspp_sparse_array_test_LDADD = gl/libgl.la $(LIBINTL) 
176 tests_libpspp_sparse_array_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
177
178 tests_libpspp_sparse_xarray_test_SOURCES = \
179         src/libpspp/argv-parser.c \
180         src/libpspp/bt.c \
181         src/libpspp/deque.c \
182         src/libpspp/ext-array.c \
183         src/libpspp/model-checker.c \
184         src/libpspp/range-set.c \
185         src/libpspp/sparse-array.c \
186         src/libpspp/sparse-xarray.c \
187         src/libpspp/str.c \
188         src/libpspp/pool.c \
189         src/libpspp/temp-file.c \
190         tests/libpspp/sparse-xarray-test.c
191 tests_libpspp_sparse_xarray_test_LDADD = gl/libgl.la $(LIBINTL) 
192 tests_libpspp_sparse_xarray_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
193
194 tests_data_inexactify_SOURCES = tests/data/inexactify.c
195
196 noinst_PROGRAMS += tests/dissect-sysfile
197 tests_dissect_sysfile_SOURCES = \
198         src/libpspp/integer-format.c \
199         src/libpspp/float-format.c \
200         tests/dissect-sysfile.c
201 tests_dissect_sysfile_LDADD = gl/libgl.la $(LIBINTL) 
202 tests_dissect_sysfile_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\"
203
204 check_PROGRAMS += tests/language/lexer/command-name-test
205 tests_language_lexer_command_name_test_SOURCES = \
206         src/data/identifier.c \
207         src/language/lexer/command-name.c \
208         tests/language/lexer/command-name-test.c
209 tests_language_lexer_command_name_test_LDADD = \
210         src/libpspp/libpspp.la \
211         gl/libgl.la \
212         $(LIBINTL) 
213 tests_language_lexer_command_name_test_CFLAGS = $(AM_CFLAGS)
214
215 check_PROGRAMS += tests/language/lexer/scan-test
216 tests_language_lexer_scan_test_SOURCES = \
217         src/data/identifier.c \
218         src/language/lexer/command-name.c \
219         src/language/lexer/scan.c \
220         src/language/lexer/segment.c \
221         src/language/lexer/token.c \
222         src/libpspp/pool.c \
223         src/libpspp/prompt.c \
224         src/libpspp/str.c \
225         src/libpspp/temp-file.c \
226         tests/language/lexer/scan-test.c
227 tests_language_lexer_scan_test_LDADD = gl/libgl.la $(LIBINTL)
228 tests_language_lexer_scan_test_CFLAGS = $(AM_CFLAGS)
229
230 check_PROGRAMS += tests/language/lexer/segment-test
231 tests_language_lexer_segment_test_SOURCES = \
232         src/data/identifier.c \
233         src/language/lexer/command-name.c \
234         src/language/lexer/segment.c \
235         src/libpspp/pool.c \
236         src/libpspp/prompt.c \
237         src/libpspp/str.c \
238         src/libpspp/temp-file.c \
239         tests/language/lexer/segment-test.c
240 tests_language_lexer_segment_test_LDADD = gl/libgl.la $(LIBINTL)
241 tests_language_lexer_segment_test_CFLAGS = $(AM_CFLAGS)
242
243 check_PROGRAMS += tests/output/render-test
244 tests_output_render_test_SOURCES = tests/output/render-test.c
245 tests_output_render_test_LDADD = \
246         src/libpspp.la \
247         src/libpspp-core.la \
248         $(CAIRO_LIBS) \
249         $(LIBICONV) \
250         $(LIBINTL)
251
252 EXTRA_DIST += \
253         tests/coverage.sh \
254         tests/data/bcd-in.expected.cmp.gz \
255         tests/data/binhex-in.expected.cmp.gz \
256         tests/data/binhex-out.expected.gz \
257         tests/data/legacy-in.expected.cmp.gz \
258         tests/data/num-in.expected.gz \
259         tests/data/num-out-cmp.pl \
260         tests/data/num-out.expected.cmp.gz \
261         tests/data/v13.sav \
262         tests/data/v14.sav \
263         tests/language/data-io/Book1.gnm.unzipped
264
265 CLEANFILES += *.save pspp.* foo*
266
267 EXTRA_DIST += tests/OChangeLog
268 \f
269 # Autotest testsuite
270
271 EXTRA_DIST += \
272         tests/testsuite.in \
273         $(TESTSUITE_AT) \
274         $(TESTSUITE) \
275         tests/atlocal.in \
276         $(srcdir)/package.m4 \
277         $(TESTSUITE)
278
279 TESTSUITE_AT = \
280         tests/data/calendar.at \
281         tests/data/data-in.at \
282         tests/data/data-out.at \
283         tests/data/datasheet-test.at \
284         tests/data/format-guesser.at \
285         tests/data/por-file.at \
286         tests/data/sys-file-reader.at \
287         tests/data/sys-file.at \
288         tests/language/command.at \
289         tests/language/control/do-if.at \
290         tests/language/control/do-repeat.at \
291         tests/language/control/loop.at \
292         tests/language/control/temporary.at \
293         tests/language/data-io/add-files.at \
294         tests/language/data-io/data-list.at \
295         tests/language/data-io/data-reader.at \
296         tests/language/data-io/file-handle.at \
297         tests/language/data-io/get-data-gnm.at \
298         tests/language/data-io/get-data-psql.at \
299         tests/language/data-io/get-data-txt.at \
300         tests/language/data-io/get.at \
301         tests/language/data-io/inpt-pgm.at \
302         tests/language/data-io/list.at \
303         tests/language/data-io/match-files.at \
304         tests/language/data-io/print-space.at \
305         tests/language/data-io/print.at \
306         tests/language/data-io/save.at \
307         tests/language/data-io/save-translate.at \
308         tests/language/data-io/update.at \
309         tests/language/dictionary/attributes.at \
310         tests/language/dictionary/formats.at \
311         tests/language/dictionary/missing-values.at \
312         tests/language/dictionary/mrsets.at \
313         tests/language/dictionary/rename-variables.at \
314         tests/language/dictionary/split-file.at \
315         tests/language/dictionary/sys-file-info.at \
316         tests/language/dictionary/value-labels.at \
317         tests/language/dictionary/variable-display.at \
318         tests/language/dictionary/vector.at \
319         tests/language/dictionary/weight.at \
320         tests/language/expressions/evaluate.at \
321         tests/language/expressions/parse.at \
322         tests/language/lexer/command-name.at \
323         tests/language/lexer/lexer.at \
324         tests/language/lexer/q2c.at \
325         tests/language/lexer/scan.at \
326         tests/language/lexer/segment.at \
327         tests/language/lexer/variable-parser.at \
328         tests/language/stats/aggregate.at \
329         tests/language/stats/autorecode.at \
330         tests/language/stats/correlations.at \
331         tests/language/stats/crosstabs.at \
332         tests/language/stats/descriptives.at \
333         tests/language/stats/examine.at \
334         tests/language/stats/factor.at \
335         tests/language/stats/flip.at \
336         tests/language/stats/frequencies.at \
337         tests/language/stats/npar.at \
338         tests/language/stats/oneway.at \
339         tests/language/stats/rank.at \
340         tests/language/stats/regression.at \
341         tests/language/stats/reliability.at \
342         tests/language/stats/roc.at \
343         tests/language/stats/sort-cases.at \
344         tests/language/stats/t-test.at \
345         tests/language/utilities/cache.at \
346         tests/language/utilities/date.at \
347         tests/language/utilities/insert.at \
348         tests/language/utilities/permissions.at \
349         tests/language/utilities/set.at \
350         tests/language/utilities/title.at \
351         tests/language/xforms/compute.at \
352         tests/language/xforms/count.at \
353         tests/language/xforms/recode.at \
354         tests/language/xforms/sample.at \
355         tests/language/xforms/select-if.at \
356         tests/libpspp/abt.at \
357         tests/libpspp/bt.at \
358         tests/libpspp/encoding-guesser.at \
359         tests/libpspp/float-format.at \
360         tests/libpspp/heap.at \
361         tests/libpspp/hmap.at \
362         tests/libpspp/hmapx.at \
363         tests/libpspp/i18n.at \
364         tests/libpspp/ll.at \
365         tests/libpspp/llx.at \
366         tests/libpspp/range-map.at \
367         tests/libpspp/range-set.at \
368         tests/libpspp/sparse-array.at \
369         tests/libpspp/sparse-xarray-test.at \
370         tests/libpspp/str.at \
371         tests/libpspp/string-map.at \
372         tests/libpspp/stringi-map.at \
373         tests/libpspp/string-set.at \
374         tests/libpspp/stringi-set.at \
375         tests/libpspp/tower.at \
376         tests/libpspp/u8-istream.at \
377         tests/math/moments.at \
378         tests/math/randist.at \
379         tests/output/ascii.at \
380         tests/output/charts.at \
381         tests/output/output.at \
382         tests/output/paper-size.at \
383         tests/output/render.at \
384         tests/ui/terminal/main.at \
385         tests/perl-module.at
386
387 TESTSUITE = $(srcdir)/tests/testsuite
388 DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
389 AUTOTEST_PATH = tests/data:tests/language/lexer:tests/libpspp:tests/output:src/ui/terminal
390
391 $(srcdir)/tests/testsuite.at: tests/testsuite.in tests/automake.mk
392         cp $< $@
393         for t in $(TESTSUITE_AT); do \
394           echo "m4_include([$$t])" >> $@ ;\
395         done
396 EXTRA_DIST += tests/testsuite.at
397
398 CHECK_LOCAL += tests_check
399 tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS)
400         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
401
402 CLEAN_LOCAL += tests_clean
403 tests_clean:
404         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
405
406 AUTOM4TE = $(SHELL) $(srcdir)/build-aux/missing --run autom4te
407 AUTOTEST = $(AUTOM4TE) --language=autotest
408 $(TESTSUITE): package.m4 $(srcdir)/tests/testsuite.at $(TESTSUITE_AT) 
409         $(AUTOTEST) -I '$(srcdir)' $@.at | sed 's/@<00A0>@/ /g' > $@.tmp
410         mv $@.tmp $@
411
412 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
413 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
414         :;{ \
415           echo '# Signature of the current package.' && \
416           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
417           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
418           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
419           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
420           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \
421           echo 'm4_define([AT_PACKAGE_URL],       [$(PACKAGE_URL)])'; \
422         } >'$(srcdir)/package.m4'
423 \f
424 # valgrind support for Autotest testsuite
425
426 valgrind_wrappers = \
427         tests/valgrind/datasheet-test \
428         tests/valgrind/command-name-test \
429         tests/valgrind/scan-test \
430         tests/valgrind/segment-test \
431         tests/valgrind/abt-test \
432         tests/valgrind/bt-test \
433         tests/valgrind/encoding-guesser-test \
434         tests/valgrind/heap-test \
435         tests/valgrind/hmap-test \
436         tests/valgrind/hmapx-test \
437         tests/valgrind/i18n-test \
438         tests/valgrind/ll-test \
439         tests/valgrind/llx-test \
440         tests/valgrind/range-map-test \
441         tests/valgrind/range-set-test \
442         tests/valgrind/sparse-array-test \
443         tests/valgrind/sparse-xarray-test \
444         tests/valgrind/str-test \
445         tests/valgrind/string-map-test \
446         tests/valgrind/stringi-map-test \
447         tests/valgrind/string-set-test \
448         tests/valgrind/stringi-set-test \
449         tests/valgrind/tower-test \
450         tests/valgrind/u8-istream-test \
451         tests/valgrind/render-test \
452         tests/valgrind/pspp
453
454 $(valgrind_wrappers): tests/valgrind-wrapper.in
455         @test -d tests/valgrind || mkdir tests/valgrind
456         sed -e 's,[@]wrap_program[@],$@,' \
457                 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
458         chmod +x $@.tmp
459         mv $@.tmp $@
460 CLEANFILES += $(valgrind_wrappers)
461 EXTRA_DIST += tests/valgrind-wrapper.in
462
463 VALGRIND = $(SHELL) $(abs_top_builddir)/libtool --mode=execute valgrind --log-file=valgrind.%p --leak-check=full --num-callers=20
464 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) $(valgrind_wrappers)
465         $(SHELL) '$(TESTSUITE)' -C tests VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
466         @echo
467         @echo '--------------------------------'
468         @echo 'Valgrind output is in:'
469         @echo 'tests/testsuite.dir/*/valgrind.*'
470         @echo '--------------------------------'