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