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