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