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