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