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