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