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