tests: Convert expression parsing test 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/bcd-in.sh \
14         tests/formats/binhex-out.sh \
15         tests/formats/date-in.sh \
16         tests/formats/date-out.sh \
17         tests/formats/float-format.sh \
18         tests/formats/format-guesser.sh \
19         tests/formats/ib-in.sh \
20         tests/formats/legacy-in.sh \
21         tests/formats/month-in.sh \
22         tests/formats/month-out.sh \
23         tests/formats/num-in.sh \
24         tests/formats/num-out.sh \
25         tests/formats/time-in.sh \
26         tests/formats/time-out.sh \
27         tests/formats/wkday-in.sh \
28         tests/formats/wkday-out.sh \
29         tests/formats/360.sh \
30         tests/bugs/multipass.sh \
31         tests/bugs/overwrite-input-file.sh \
32         tests/bugs/overwrite-special-file.sh \
33         tests/bugs/shbang.sh \
34         tests/bugs/signals.sh \
35         tests/bugs/temporary.sh \
36         tests/bugs/unwritable-dir.sh \
37         tests/bugs/val-labs.sh \
38         tests/bugs/val-labs-trailing-slash.sh \
39         tests/bugs/keep-all.sh \
40         tests/data/datasheet-test.sh \
41         tests/libpspp/sparse-xarray-test.sh \
42         tests/output/paper-size.sh \
43         tests/expressions/randist.sh \
44         tests/expressions/valuelabel.sh \
45         tests/expressions/variables.sh \
46         tests/expressions/vectors.sh
47
48 TESTS = $(dist_TESTS) $(nodist_TESTS)
49
50 check_PROGRAMS += \
51         $(nodist_TESTS) \
52         tests/data/datasheet-test \
53         tests/formats/inexactify \
54         tests/libpspp/abt-test \
55         tests/libpspp/bt-test \
56         tests/libpspp/heap-test \
57         tests/libpspp/hmap-test \
58         tests/libpspp/hmapx-test \
59         tests/libpspp/i18n-test \
60         tests/libpspp/ll-test \
61         tests/libpspp/llx-test \
62         tests/libpspp/range-map-test \
63         tests/libpspp/range-set-test \
64         tests/libpspp/sparse-array-test \
65         tests/libpspp/sparse-xarray-test \
66         tests/libpspp/str-test \
67         tests/libpspp/string-map-test \
68         tests/libpspp/stringi-map-test \
69         tests/libpspp/string-set-test \
70         tests/libpspp/stringi-set-test \
71         tests/libpspp/tower-test \
72         tests/output/render-test
73
74 tests_data_datasheet_test_SOURCES = \
75         tests/data/datasheet-test.c
76 tests_data_datasheet_test_LDADD = src/libpspp-core.la $(LIBINTL) 
77 tests_data_datasheet_test_CFLAGS = $(AM_CFLAGS)
78
79 tests_libpspp_ll_test_SOURCES = \
80         src/libpspp/ll.c \
81         tests/libpspp/ll-test.c
82 tests_libpspp_ll_test_LDADD = gl/libgl.la $(LIBINTL)
83 tests_libpspp_ll_test_CFLAGS = $(AM_CFLAGS)
84
85 tests_libpspp_llx_test_SOURCES = \
86         src/libpspp/ll.c \
87         src/libpspp/llx.c \
88         tests/libpspp/llx-test.c
89 tests_libpspp_llx_test_LDADD = gl/libgl.la $(LIBINTL)
90 tests_libpspp_llx_test_CFLAGS = $(AM_CFLAGS)
91
92 tests_libpspp_heap_test_SOURCES = \
93         src/libpspp/heap.c \
94         src/libpspp/pool.c \
95         src/libpspp/temp-file.c \
96         tests/libpspp/heap-test.c
97 tests_libpspp_heap_test_LDADD = gl/libgl.la $(LIBINTL) 
98 tests_libpspp_heap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
99
100 tests_libpspp_hmap_test_SOURCES = \
101         src/libpspp/hmap.c \
102         tests/libpspp/hmap-test.c
103 tests_libpspp_hmap_test_LDADD = gl/libgl.la $(LIBINTL)
104 tests_libpspp_hmap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
105
106 tests_libpspp_hmapx_test_SOURCES = \
107         src/libpspp/hmap.c \
108         src/libpspp/hmapx.c \
109         tests/libpspp/hmapx-test.c
110 tests_libpspp_hmapx_test_LDADD = gl/libgl.la $(LIBINTL)
111 tests_libpspp_hmapx_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
112
113 tests_libpspp_i18n_test_SOURCES = tests/libpspp/i18n-test.c
114 tests_libpspp_i18n_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) 
115
116 tests_libpspp_abt_test_SOURCES = \
117         src/libpspp/abt.c \
118         tests/libpspp/abt-test.c
119 tests_libpspp_abt_test_LDADD = gl/libgl.la $(LIBINTL)
120 tests_libpspp_abt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
121
122 tests_libpspp_bt_test_SOURCES = \
123         src/libpspp/bt.c \
124         tests/libpspp/bt-test.c
125 tests_libpspp_bt_test_LDADD = gl/libgl.la
126 tests_libpspp_bt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
127
128 tests_libpspp_range_map_test_SOURCES = \
129         src/libpspp/bt.c \
130         src/libpspp/range-map.c \
131         tests/libpspp/range-map-test.c
132 tests_libpspp_range_map_test_LDADD = gl/libgl.la $(LIBINTL)
133 tests_libpspp_range_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
134
135 tests_libpspp_range_set_test_SOURCES = \
136         src/libpspp/bt.c \
137         src/libpspp/pool.c \
138         src/libpspp/range-set.c \
139         src/libpspp/temp-file.c \
140         tests/libpspp/range-set-test.c
141 tests_libpspp_range_set_test_LDADD = gl/libgl.la $(LIBINTL) 
142 tests_libpspp_range_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
143
144 tests_libpspp_str_test_SOURCES = \
145         tests/libpspp/str-test.c
146 tests_libpspp_str_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) 
147
148 tests_libpspp_string_map_test_SOURCES = \
149         src/libpspp/hash-functions.c \
150         src/libpspp/hmap.c \
151         src/libpspp/string-map.c \
152         src/libpspp/string-set.c \
153         tests/libpspp/string-map-test.c
154 tests_libpspp_string_map_test_LDADD = gl/libgl.la $(LIBINTL)
155 tests_libpspp_string_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
156
157 tests_libpspp_stringi_map_test_SOURCES = \
158         src/libpspp/hash-functions.c \
159         src/libpspp/hmap.c \
160         src/libpspp/pool.c \
161         src/libpspp/str.c \
162         src/libpspp/stringi-map.c \
163         src/libpspp/string-set.c \
164         src/libpspp/stringi-set.c \
165         src/libpspp/temp-file.c \
166         tests/libpspp/stringi-map-test.c
167 tests_libpspp_stringi_map_test_LDADD = gl/libgl.la $(LIBINTL)
168 tests_libpspp_stringi_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
169
170 tests_libpspp_string_set_test_SOURCES = \
171         src/libpspp/hash-functions.c \
172         src/libpspp/hmap.c \
173         src/libpspp/string-set.c \
174         tests/libpspp/string-set-test.c
175 tests_libpspp_string_set_test_LDADD = gl/libgl.la $(LIBINTL)
176 tests_libpspp_string_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
177
178 tests_libpspp_stringi_set_test_SOURCES = \
179         src/libpspp/hash-functions.c \
180         src/libpspp/hmap.c \
181         src/libpspp/pool.c \
182         src/libpspp/str.c \
183         src/libpspp/stringi-set.c \
184         src/libpspp/temp-file.c \
185         tests/libpspp/stringi-set-test.c
186 tests_libpspp_stringi_set_test_LDADD = gl/libgl.la $(LIBINTL)
187 tests_libpspp_stringi_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
188
189 tests_libpspp_tower_test_SOURCES = \
190         src/libpspp/abt.c \
191         src/libpspp/pool.c \
192         src/libpspp/temp-file.c \
193         src/libpspp/tower.c \
194         tests/libpspp/tower-test.c
195 tests_libpspp_tower_test_LDADD = gl/libgl.la $(LIBINTL) 
196 tests_libpspp_tower_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
197
198 tests_libpspp_sparse_array_test_SOURCES = \
199         src/libpspp/sparse-array.c \
200         src/libpspp/pool.c \
201         tests/libpspp/sparse-array-test.c \
202         src/libpspp/temp-file.c
203 tests_libpspp_sparse_array_test_LDADD = gl/libgl.la $(LIBINTL) 
204 tests_libpspp_sparse_array_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
205
206 tests_libpspp_sparse_xarray_test_SOURCES = \
207         src/libpspp/argv-parser.c \
208         src/libpspp/bt.c \
209         src/libpspp/deque.c \
210         src/libpspp/ext-array.c \
211         src/libpspp/model-checker.c \
212         src/libpspp/range-set.c \
213         src/libpspp/sparse-array.c \
214         src/libpspp/sparse-xarray.c \
215         src/libpspp/str.c \
216         src/libpspp/pool.c \
217         src/libpspp/temp-file.c \
218         tests/libpspp/sparse-xarray-test.c
219 tests_libpspp_sparse_xarray_test_LDADD = gl/libgl.la $(LIBINTL) 
220 tests_libpspp_sparse_xarray_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
221
222 tests_formats_inexactify_SOURCES = tests/formats/inexactify.c
223
224 noinst_PROGRAMS += tests/dissect-sysfile
225 tests_dissect_sysfile_SOURCES = \
226         src/libpspp/integer-format.c \
227         src/libpspp/float-format.c \
228         tests/dissect-sysfile.c
229 tests_dissect_sysfile_LDADD = gl/libgl.la $(LIBINTL) 
230 tests_dissect_sysfile_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\"
231
232 check_PROGRAMS += tests/output/render-test
233 tests_output_render_test_SOURCES = tests/output/render-test.c
234 tests_output_render_test_LDADD = \
235         src/libpspp.la \
236         src/libpspp-core.la \
237         $(CAIRO_LIBS) \
238         $(LIBICONV) \
239         $(LIBINTL)
240
241 EXTRA_DIST += \
242         $(dist_TESTS) \
243         tests/coverage.sh tests/test_template \
244         tests/data/v13.sav tests/data/v14.sav \
245         tests/expressions/randist/beta.out \
246         tests/expressions/randist/cauchy.out \
247         tests/expressions/randist/chisq.out \
248         tests/expressions/randist/exp.out \
249         tests/expressions/randist/f.out \
250         tests/expressions/randist/gamma.out \
251         tests/expressions/randist/laplace.out \
252         tests/expressions/randist/lnormal.out \
253         tests/expressions/randist/logistic.out \
254         tests/expressions/randist/normal.out \
255         tests/expressions/randist/pareto.out \
256         tests/expressions/randist/compare.pl \
257         tests/expressions/randist/randist.pl \
258         tests/expressions/randist/randist.txt \
259         tests/expressions/randist/t.out \
260         tests/expressions/randist/uniform.out \
261         tests/expressions/randist/weibull.out \
262         tests/formats/bcd-in.expected.cmp.gz \
263         tests/formats/binhex-out.expected.gz \
264         tests/formats/ib-in.expected.cmp.gz \
265         tests/formats/legacy-in.expected.cmp.gz \
266         tests/formats/num-in.expected.gz \
267         tests/formats/num-out.expected.cmp.gz \
268         tests/formats/num-out-cmp.pl \
269         tests/formats/num-out-compare.pl \
270         tests/formats/num-out-decmp.pl \
271         tests/formats/num-out.pl \
272         tests/language/data-io/Book1.gnm.unzipped
273
274 CLEANFILES += *.save pspp.* foo*
275
276 check-for-export-var-val:
277         @if grep -q 'export .*=' $(dist_TESTS) ; then \
278          echo 'One or more tests contain non-portable "export VAR=val" syntax' ; \
279          false ; \
280         fi
281
282 DIST_HOOKS += check-for-export-var-val
283
284 EXTRA_DIST += tests/OChangeLog
285 \f
286 # Autotest testsuite
287
288 EXTRA_DIST += \
289         tests/testsuite.in \
290         $(TESTSUITE_AT) \
291         $(TESTSUITE) \
292         tests/atlocal.in \
293         $(srcdir)/package.m4 \
294         $(TESTSUITE)
295
296 TESTSUITE_AT = \
297         tests/data/calendar.at \
298         tests/data/data-in.at \
299         tests/data/sys-file.at \
300         tests/language/command.at \
301         tests/language/control/do-if.at \
302         tests/language/control/do-repeat.at \
303         tests/language/control/loop.at \
304         tests/language/data-io/add-files.at \
305         tests/language/data-io/data-list.at \
306         tests/language/data-io/data-reader.at \
307         tests/language/data-io/file-handle.at \
308         tests/language/data-io/get-data-gnm.at \
309         tests/language/data-io/get-data-psql.at \
310         tests/language/data-io/get-data-txt.at \
311         tests/language/data-io/get.at \
312         tests/language/data-io/inpt-pgm.at \
313         tests/language/data-io/list.at \
314         tests/language/data-io/match-files.at \
315         tests/language/data-io/print.at \
316         tests/language/data-io/save.at \
317         tests/language/data-io/save-translate.at \
318         tests/language/data-io/update.at \
319         tests/language/dictionary/attributes.at \
320         tests/language/dictionary/missing-values.at \
321         tests/language/dictionary/mrsets.at \
322         tests/language/dictionary/rename-variables.at \
323         tests/language/dictionary/split-file.at \
324         tests/language/dictionary/sys-file-info.at \
325         tests/language/dictionary/variable-display.at \
326         tests/language/dictionary/vector.at \
327         tests/language/dictionary/weight.at \
328         tests/language/expressions/evaluate.at \
329         tests/language/expressions/parse.at \
330         tests/language/lexer/q2c.at \
331         tests/language/lexer/variable-parser.at \
332         tests/language/stats/aggregate.at \
333         tests/language/stats/autorecode.at \
334         tests/language/stats/correlations.at \
335         tests/language/stats/crosstabs.at \
336         tests/language/stats/descriptives.at \
337         tests/language/stats/examine.at \
338         tests/language/stats/factor.at \
339         tests/language/stats/flip.at \
340         tests/language/stats/frequencies.at \
341         tests/language/stats/npar.at \
342         tests/language/stats/oneway.at \
343         tests/language/stats/rank.at \
344         tests/language/stats/regression.at \
345         tests/language/stats/reliability.at \
346         tests/language/stats/roc.at \
347         tests/language/stats/sort-cases.at \
348         tests/language/stats/t-test.at \
349         tests/language/utilities/date.at \
350         tests/language/utilities/insert.at \
351         tests/language/utilities/permissions.at \
352         tests/language/utilities/set.at \
353         tests/language/utilities/title.at \
354         tests/language/xforms/compute.at \
355         tests/language/xforms/count.at \
356         tests/language/xforms/recode.at \
357         tests/language/xforms/sample.at \
358         tests/language/xforms/select-if.at \
359         tests/libpspp/abt.at \
360         tests/libpspp/bt.at \
361         tests/libpspp/heap.at \
362         tests/libpspp/hmap.at \
363         tests/libpspp/hmapx.at \
364         tests/libpspp/i18n.at \
365         tests/libpspp/ll.at \
366         tests/libpspp/llx.at \
367         tests/libpspp/range-map.at \
368         tests/libpspp/range-set.at \
369         tests/libpspp/sparse-array.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/math/moments.at \
377         tests/output/render.at \
378         tests/output/charts.at \
379         tests/ui/terminal/main.at \
380         tests/perl-module.at
381
382 TESTSUITE = $(srcdir)/tests/testsuite
383 DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
384
385 $(srcdir)/tests/testsuite.at: tests/testsuite.in tests/automake.mk
386         cp $< $@
387         for t in $(TESTSUITE_AT); do \
388           echo "m4_include([$$t])" >> $@ ;\
389         done
390 EXTRA_DIST += tests/testsuite.at
391
392 CHECK_LOCAL += tests_check
393 tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS)
394         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=tests/libpspp:tests/output:src/ui/terminal $(TESTSUITEFLAGS)
395
396 CLEAN_LOCAL += tests_clean
397 tests_clean:
398         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
399
400 AUTOM4TE = $(SHELL) $(srcdir)/build-aux/missing --run autom4te
401 AUTOTEST = $(AUTOM4TE) --language=autotest
402 $(TESTSUITE): package.m4 $(srcdir)/tests/testsuite.at $(TESTSUITE_AT) 
403         $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
404         mv $@.tmp $@
405
406 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
407 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
408         :;{ \
409           echo '# Signature of the current package.' && \
410           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
411           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
412           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
413           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
414           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \
415           echo 'm4_define([AT_PACKAGE_URL],       [$(PACKAGE_URL)])'; \
416         } >'$(srcdir)/package.m4'