data-in: Convert tests for date formats to Autotest framework.
[pspp-builds.git] / tests / automake.mk
1 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
2
3 TESTS_ENVIRONMENT = top_srcdir='$(top_srcdir)' top_builddir='$(top_builddir)'
4 TESTS_ENVIRONMENT += PERL='$(PERL)'
5
6 # Allow locale_charset to find charset.alias before running "make install".
7 TESTS_ENVIRONMENT += CHARSETALIASDIR='$(abs_top_builddir)/gl'
8
9 TESTS_ENVIRONMENT += LC_ALL=C
10 TESTS_ENVIRONMENT += EXEEXT=$(EXEEXT)
11
12 dist_TESTS = \
13         tests/formats/num-out.sh \
14         tests/formats/time-in.sh \
15         tests/formats/360.sh
16
17 TESTS = $(dist_TESTS) $(nodist_TESTS)
18
19 check_PROGRAMS += \
20         $(nodist_TESTS) \
21         tests/data/datasheet-test \
22         tests/formats/inexactify \
23         tests/libpspp/abt-test \
24         tests/libpspp/bt-test \
25         tests/libpspp/heap-test \
26         tests/libpspp/hmap-test \
27         tests/libpspp/hmapx-test \
28         tests/libpspp/i18n-test \
29         tests/libpspp/ll-test \
30         tests/libpspp/llx-test \
31         tests/libpspp/range-map-test \
32         tests/libpspp/range-set-test \
33         tests/libpspp/sparse-array-test \
34         tests/libpspp/sparse-xarray-test \
35         tests/libpspp/str-test \
36         tests/libpspp/string-map-test \
37         tests/libpspp/stringi-map-test \
38         tests/libpspp/string-set-test \
39         tests/libpspp/stringi-set-test \
40         tests/libpspp/tower-test \
41         tests/output/render-test
42
43 tests_data_datasheet_test_SOURCES = \
44         tests/data/datasheet-test.c
45 tests_data_datasheet_test_LDADD = src/libpspp-core.la $(LIBINTL) 
46 tests_data_datasheet_test_CFLAGS = $(AM_CFLAGS)
47
48 tests_libpspp_ll_test_SOURCES = \
49         src/libpspp/ll.c \
50         tests/libpspp/ll-test.c
51 tests_libpspp_ll_test_LDADD = gl/libgl.la $(LIBINTL)
52 tests_libpspp_ll_test_CFLAGS = $(AM_CFLAGS)
53
54 tests_libpspp_llx_test_SOURCES = \
55         src/libpspp/ll.c \
56         src/libpspp/llx.c \
57         tests/libpspp/llx-test.c
58 tests_libpspp_llx_test_LDADD = gl/libgl.la $(LIBINTL)
59 tests_libpspp_llx_test_CFLAGS = $(AM_CFLAGS)
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_sparse_array_test_SOURCES = \
168         src/libpspp/sparse-array.c \
169         src/libpspp/pool.c \
170         tests/libpspp/sparse-array-test.c \
171         src/libpspp/temp-file.c
172 tests_libpspp_sparse_array_test_LDADD = gl/libgl.la $(LIBINTL) 
173 tests_libpspp_sparse_array_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
174
175 tests_libpspp_sparse_xarray_test_SOURCES = \
176         src/libpspp/argv-parser.c \
177         src/libpspp/bt.c \
178         src/libpspp/deque.c \
179         src/libpspp/ext-array.c \
180         src/libpspp/model-checker.c \
181         src/libpspp/range-set.c \
182         src/libpspp/sparse-array.c \
183         src/libpspp/sparse-xarray.c \
184         src/libpspp/str.c \
185         src/libpspp/pool.c \
186         src/libpspp/temp-file.c \
187         tests/libpspp/sparse-xarray-test.c
188 tests_libpspp_sparse_xarray_test_LDADD = gl/libgl.la $(LIBINTL) 
189 tests_libpspp_sparse_xarray_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
190
191 tests_formats_inexactify_SOURCES = tests/formats/inexactify.c
192
193 noinst_PROGRAMS += tests/dissect-sysfile
194 tests_dissect_sysfile_SOURCES = \
195         src/libpspp/integer-format.c \
196         src/libpspp/float-format.c \
197         tests/dissect-sysfile.c
198 tests_dissect_sysfile_LDADD = gl/libgl.la $(LIBINTL) 
199 tests_dissect_sysfile_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\"
200
201 check_PROGRAMS += tests/output/render-test
202 tests_output_render_test_SOURCES = tests/output/render-test.c
203 tests_output_render_test_LDADD = \
204         src/libpspp.la \
205         src/libpspp-core.la \
206         $(CAIRO_LIBS) \
207         $(LIBICONV) \
208         $(LIBINTL)
209
210 EXTRA_DIST += \
211         $(dist_TESTS) \
212         tests/coverage.sh tests/test_template \
213         tests/data/bcd-in.expected.cmp.gz \
214         tests/data/binhex-in.expected.cmp.gz \
215         tests/data/binhex-out.expected.gz \
216         tests/data/legacy-in.expected.cmp.gz \
217         tests/data/num-in.expected.gz \
218         tests/data/v13.sav \
219         tests/data/v14.sav \
220         tests/formats/num-out.expected.cmp.gz \
221         tests/formats/num-out-cmp.pl \
222         tests/formats/num-out-compare.pl \
223         tests/formats/num-out-decmp.pl \
224         tests/formats/num-out.pl \
225         tests/language/data-io/Book1.gnm.unzipped
226
227 CLEANFILES += *.save pspp.* foo*
228
229 check-for-export-var-val:
230         @if grep -q 'export .*=' $(dist_TESTS) ; then \
231          echo 'One or more tests contain non-portable "export VAR=val" syntax' ; \
232          false ; \
233         fi
234
235 DIST_HOOKS += check-for-export-var-val
236
237 EXTRA_DIST += tests/OChangeLog
238 \f
239 # Autotest testsuite
240
241 EXTRA_DIST += \
242         tests/testsuite.in \
243         $(TESTSUITE_AT) \
244         $(TESTSUITE) \
245         tests/atlocal.in \
246         $(srcdir)/package.m4 \
247         $(TESTSUITE)
248
249 TESTSUITE_AT = \
250         tests/data/calendar.at \
251         tests/data/data-in.at \
252         tests/data/data-out.at \
253         tests/data/datasheet-test.at \
254         tests/data/format-guesser.at \
255         tests/data/por-file.at \
256         tests/data/sys-file.at \
257         tests/language/command.at \
258         tests/language/control/do-if.at \
259         tests/language/control/do-repeat.at \
260         tests/language/control/loop.at \
261         tests/language/control/temporary.at \
262         tests/language/data-io/add-files.at \
263         tests/language/data-io/data-list.at \
264         tests/language/data-io/data-reader.at \
265         tests/language/data-io/file-handle.at \
266         tests/language/data-io/get-data-gnm.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.at \
274         tests/language/data-io/save.at \
275         tests/language/data-io/save-translate.at \
276         tests/language/data-io/update.at \
277         tests/language/dictionary/attributes.at \
278         tests/language/dictionary/missing-values.at \
279         tests/language/dictionary/mrsets.at \
280         tests/language/dictionary/rename-variables.at \
281         tests/language/dictionary/split-file.at \
282         tests/language/dictionary/sys-file-info.at \
283         tests/language/dictionary/value-labels.at \
284         tests/language/dictionary/variable-display.at \
285         tests/language/dictionary/vector.at \
286         tests/language/dictionary/weight.at \
287         tests/language/expressions/evaluate.at \
288         tests/language/expressions/parse.at \
289         tests/language/lexer/lexer.at \
290         tests/language/lexer/q2c.at \
291         tests/language/lexer/variable-parser.at \
292         tests/language/stats/aggregate.at \
293         tests/language/stats/autorecode.at \
294         tests/language/stats/correlations.at \
295         tests/language/stats/crosstabs.at \
296         tests/language/stats/descriptives.at \
297         tests/language/stats/examine.at \
298         tests/language/stats/factor.at \
299         tests/language/stats/flip.at \
300         tests/language/stats/frequencies.at \
301         tests/language/stats/npar.at \
302         tests/language/stats/oneway.at \
303         tests/language/stats/rank.at \
304         tests/language/stats/regression.at \
305         tests/language/stats/reliability.at \
306         tests/language/stats/roc.at \
307         tests/language/stats/sort-cases.at \
308         tests/language/stats/t-test.at \
309         tests/language/utilities/date.at \
310         tests/language/utilities/insert.at \
311         tests/language/utilities/permissions.at \
312         tests/language/utilities/set.at \
313         tests/language/utilities/title.at \
314         tests/language/xforms/compute.at \
315         tests/language/xforms/count.at \
316         tests/language/xforms/recode.at \
317         tests/language/xforms/sample.at \
318         tests/language/xforms/select-if.at \
319         tests/libpspp/abt.at \
320         tests/libpspp/bt.at \
321         tests/libpspp/float-format.at \
322         tests/libpspp/heap.at \
323         tests/libpspp/hmap.at \
324         tests/libpspp/hmapx.at \
325         tests/libpspp/i18n.at \
326         tests/libpspp/ll.at \
327         tests/libpspp/llx.at \
328         tests/libpspp/range-map.at \
329         tests/libpspp/range-set.at \
330         tests/libpspp/sparse-array.at \
331         tests/libpspp/sparse-xarray-test.at \
332         tests/libpspp/str.at \
333         tests/libpspp/string-map.at \
334         tests/libpspp/stringi-map.at \
335         tests/libpspp/string-set.at \
336         tests/libpspp/stringi-set.at \
337         tests/libpspp/tower.at \
338         tests/math/moments.at \
339         tests/math/randist.at \
340         tests/output/charts.at \
341         tests/output/output.at \
342         tests/output/paper-size.at \
343         tests/output/render.at \
344         tests/ui/terminal/main.at \
345         tests/perl-module.at
346
347 TESTSUITE = $(srcdir)/tests/testsuite
348 DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
349
350 $(srcdir)/tests/testsuite.at: tests/testsuite.in tests/automake.mk
351         cp $< $@
352         for t in $(TESTSUITE_AT); do \
353           echo "m4_include([$$t])" >> $@ ;\
354         done
355 EXTRA_DIST += tests/testsuite.at
356
357 CHECK_LOCAL += tests_check
358 tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS)
359         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=tests/data:tests/libpspp:tests/output:src/ui/terminal $(TESTSUITEFLAGS)
360
361 CLEAN_LOCAL += tests_clean
362 tests_clean:
363         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
364
365 AUTOM4TE = $(SHELL) $(srcdir)/build-aux/missing --run autom4te
366 AUTOTEST = $(AUTOM4TE) --language=autotest
367 $(TESTSUITE): package.m4 $(srcdir)/tests/testsuite.at $(TESTSUITE_AT) 
368         $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
369         mv $@.tmp $@
370
371 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
372 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
373         :;{ \
374           echo '# Signature of the current package.' && \
375           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
376           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
377           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
378           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
379           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \
380           echo 'm4_define([AT_PACKAGE_URL],       [$(PACKAGE_URL)])'; \
381         } >'$(srcdir)/package.m4'