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