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