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