fc246a2f245603e3336b0d036a244d43a0deda68
[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/input-crash.sh \
33         tests/bugs/multipass.sh \
34         tests/bugs/overwrite-input-file.sh \
35         tests/bugs/overwrite-special-file.sh \
36         tests/bugs/random.sh \
37         tests/bugs/shbang.sh \
38         tests/bugs/signals.sh \
39         tests/bugs/temporary.sh \
40         tests/bugs/unwritable-dir.sh \
41         tests/bugs/val-labs.sh \
42         tests/bugs/val-labs-trailing-slash.sh \
43         tests/bugs/keep-all.sh \
44         tests/data/datasheet-test.sh \
45         tests/libpspp/sparse-xarray-test.sh \
46         tests/output/paper-size.sh \
47         tests/expressions/randist.sh \
48         tests/expressions/valuelabel.sh \
49         tests/expressions/variables.sh \
50         tests/expressions/vectors.sh
51
52 TESTS = $(dist_TESTS) $(nodist_TESTS)
53
54 check_PROGRAMS += \
55         $(nodist_TESTS) \
56         tests/data/datasheet-test \
57         tests/formats/inexactify \
58         tests/libpspp/abt-test \
59         tests/libpspp/bt-test \
60         tests/libpspp/heap-test \
61         tests/libpspp/hmap-test \
62         tests/libpspp/hmapx-test \
63         tests/libpspp/i18n-test \
64         tests/libpspp/ll-test \
65         tests/libpspp/llx-test \
66         tests/libpspp/range-map-test \
67         tests/libpspp/range-set-test \
68         tests/libpspp/sparse-array-test \
69         tests/libpspp/sparse-xarray-test \
70         tests/libpspp/str-test \
71         tests/libpspp/string-map-test \
72         tests/libpspp/stringi-map-test \
73         tests/libpspp/string-set-test \
74         tests/libpspp/stringi-set-test \
75         tests/libpspp/tower-test \
76         tests/output/render-test
77
78 tests_data_datasheet_test_SOURCES = \
79         tests/data/datasheet-test.c
80 tests_data_datasheet_test_LDADD = src/libpspp-core.la $(LIBINTL) 
81 tests_data_datasheet_test_CFLAGS = $(AM_CFLAGS)
82
83 tests_libpspp_ll_test_SOURCES = \
84         src/libpspp/ll.c \
85         tests/libpspp/ll-test.c
86 tests_libpspp_ll_test_LDADD = gl/libgl.la $(LIBINTL)
87 tests_libpspp_ll_test_CFLAGS = $(AM_CFLAGS)
88
89 tests_libpspp_llx_test_SOURCES = \
90         src/libpspp/ll.c \
91         src/libpspp/llx.c \
92         tests/libpspp/llx-test.c
93 tests_libpspp_llx_test_LDADD = gl/libgl.la $(LIBINTL)
94 tests_libpspp_llx_test_CFLAGS = $(AM_CFLAGS)
95
96 tests_libpspp_heap_test_SOURCES = \
97         src/libpspp/heap.c \
98         src/libpspp/pool.c \
99         src/libpspp/temp-file.c \
100         tests/libpspp/heap-test.c
101 tests_libpspp_heap_test_LDADD = gl/libgl.la $(LIBINTL) 
102 tests_libpspp_heap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
103
104 tests_libpspp_hmap_test_SOURCES = \
105         src/libpspp/hmap.c \
106         tests/libpspp/hmap-test.c
107 tests_libpspp_hmap_test_LDADD = gl/libgl.la $(LIBINTL)
108 tests_libpspp_hmap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
109
110 tests_libpspp_hmapx_test_SOURCES = \
111         src/libpspp/hmap.c \
112         src/libpspp/hmapx.c \
113         tests/libpspp/hmapx-test.c
114 tests_libpspp_hmapx_test_LDADD = gl/libgl.la $(LIBINTL)
115 tests_libpspp_hmapx_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
116
117 tests_libpspp_i18n_test_SOURCES = tests/libpspp/i18n-test.c
118 tests_libpspp_i18n_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) 
119
120 tests_libpspp_abt_test_SOURCES = \
121         src/libpspp/abt.c \
122         tests/libpspp/abt-test.c
123 tests_libpspp_abt_test_LDADD = gl/libgl.la $(LIBINTL)
124 tests_libpspp_abt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
125
126 tests_libpspp_bt_test_SOURCES = \
127         src/libpspp/bt.c \
128         tests/libpspp/bt-test.c
129 tests_libpspp_bt_test_LDADD = gl/libgl.la
130 tests_libpspp_bt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
131
132 tests_libpspp_range_map_test_SOURCES = \
133         src/libpspp/bt.c \
134         src/libpspp/range-map.c \
135         tests/libpspp/range-map-test.c
136 tests_libpspp_range_map_test_LDADD = gl/libgl.la $(LIBINTL)
137 tests_libpspp_range_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
138
139 tests_libpspp_range_set_test_SOURCES = \
140         src/libpspp/bt.c \
141         src/libpspp/pool.c \
142         src/libpspp/range-set.c \
143         src/libpspp/temp-file.c \
144         tests/libpspp/range-set-test.c
145 tests_libpspp_range_set_test_LDADD = gl/libgl.la $(LIBINTL) 
146 tests_libpspp_range_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
147
148 tests_libpspp_str_test_SOURCES = \
149         tests/libpspp/str-test.c
150 tests_libpspp_str_test_LDADD = src/libpspp/libpspp.la gl/libgl.la $(LIBINTL) 
151
152 tests_libpspp_string_map_test_SOURCES = \
153         src/libpspp/hash-functions.c \
154         src/libpspp/hmap.c \
155         src/libpspp/string-map.c \
156         src/libpspp/string-set.c \
157         tests/libpspp/string-map-test.c
158 tests_libpspp_string_map_test_LDADD = gl/libgl.la $(LIBINTL)
159 tests_libpspp_string_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
160
161 tests_libpspp_stringi_map_test_SOURCES = \
162         src/libpspp/hash-functions.c \
163         src/libpspp/hmap.c \
164         src/libpspp/pool.c \
165         src/libpspp/str.c \
166         src/libpspp/stringi-map.c \
167         src/libpspp/string-set.c \
168         src/libpspp/stringi-set.c \
169         src/libpspp/temp-file.c \
170         tests/libpspp/stringi-map-test.c
171 tests_libpspp_stringi_map_test_LDADD = gl/libgl.la $(LIBINTL)
172 tests_libpspp_stringi_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
173
174 tests_libpspp_string_set_test_SOURCES = \
175         src/libpspp/hash-functions.c \
176         src/libpspp/hmap.c \
177         src/libpspp/string-set.c \
178         tests/libpspp/string-set-test.c
179 tests_libpspp_string_set_test_LDADD = gl/libgl.la $(LIBINTL)
180 tests_libpspp_string_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
181
182 tests_libpspp_stringi_set_test_SOURCES = \
183         src/libpspp/hash-functions.c \
184         src/libpspp/hmap.c \
185         src/libpspp/pool.c \
186         src/libpspp/str.c \
187         src/libpspp/stringi-set.c \
188         src/libpspp/temp-file.c \
189         tests/libpspp/stringi-set-test.c
190 tests_libpspp_stringi_set_test_LDADD = gl/libgl.la $(LIBINTL)
191 tests_libpspp_stringi_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
192
193 tests_libpspp_tower_test_SOURCES = \
194         src/libpspp/abt.c \
195         src/libpspp/pool.c \
196         src/libpspp/temp-file.c \
197         src/libpspp/tower.c \
198         tests/libpspp/tower-test.c
199 tests_libpspp_tower_test_LDADD = gl/libgl.la $(LIBINTL) 
200 tests_libpspp_tower_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
201
202 tests_libpspp_sparse_array_test_SOURCES = \
203         src/libpspp/sparse-array.c \
204         src/libpspp/pool.c \
205         tests/libpspp/sparse-array-test.c \
206         src/libpspp/temp-file.c
207 tests_libpspp_sparse_array_test_LDADD = gl/libgl.la $(LIBINTL) 
208 tests_libpspp_sparse_array_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
209
210 tests_libpspp_sparse_xarray_test_SOURCES = \
211         src/libpspp/argv-parser.c \
212         src/libpspp/bt.c \
213         src/libpspp/deque.c \
214         src/libpspp/ext-array.c \
215         src/libpspp/model-checker.c \
216         src/libpspp/range-set.c \
217         src/libpspp/sparse-array.c \
218         src/libpspp/sparse-xarray.c \
219         src/libpspp/str.c \
220         src/libpspp/pool.c \
221         src/libpspp/temp-file.c \
222         tests/libpspp/sparse-xarray-test.c
223 tests_libpspp_sparse_xarray_test_LDADD = gl/libgl.la $(LIBINTL) 
224 tests_libpspp_sparse_xarray_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
225
226 tests_formats_inexactify_SOURCES = tests/formats/inexactify.c
227
228 noinst_PROGRAMS += tests/dissect-sysfile
229 tests_dissect_sysfile_SOURCES = \
230         src/libpspp/integer-format.c \
231         src/libpspp/float-format.c \
232         tests/dissect-sysfile.c
233 tests_dissect_sysfile_LDADD = gl/libgl.la $(LIBINTL) 
234 tests_dissect_sysfile_CPPFLAGS = $(AM_CPPFLAGS) -DINSTALLDIR=\"$(bindir)\"
235
236 check_PROGRAMS += tests/output/render-test
237 tests_output_render_test_SOURCES = tests/output/render-test.c
238 tests_output_render_test_LDADD = \
239         src/libpspp.la \
240         src/libpspp-core.la \
241         $(CAIRO_LIBS) \
242         $(LIBICONV) \
243         $(LIBINTL)
244
245 EXTRA_DIST += \
246         $(dist_TESTS) \
247         tests/coverage.sh tests/test_template \
248         tests/data/v13.sav tests/data/v14.sav \
249         tests/expressions/randist/beta.out \
250         tests/expressions/randist/cauchy.out \
251         tests/expressions/randist/chisq.out \
252         tests/expressions/randist/exp.out \
253         tests/expressions/randist/f.out \
254         tests/expressions/randist/gamma.out \
255         tests/expressions/randist/laplace.out \
256         tests/expressions/randist/lnormal.out \
257         tests/expressions/randist/logistic.out \
258         tests/expressions/randist/normal.out \
259         tests/expressions/randist/pareto.out \
260         tests/expressions/randist/compare.pl \
261         tests/expressions/randist/randist.pl \
262         tests/expressions/randist/randist.txt \
263         tests/expressions/randist/t.out \
264         tests/expressions/randist/uniform.out \
265         tests/expressions/randist/weibull.out \
266         tests/formats/bcd-in.expected.cmp.gz \
267         tests/formats/binhex-out.expected.gz \
268         tests/formats/ib-in.expected.cmp.gz \
269         tests/formats/legacy-in.expected.cmp.gz \
270         tests/formats/num-in.expected.gz \
271         tests/formats/num-out.expected.cmp.gz \
272         tests/formats/num-out-cmp.pl \
273         tests/formats/num-out-compare.pl \
274         tests/formats/num-out-decmp.pl \
275         tests/formats/num-out.pl \
276         tests/language/data-io/Book1.gnm.unzipped
277
278 CLEANFILES += *.save pspp.* foo*
279
280 check-for-export-var-val:
281         @if grep -q 'export .*=' $(dist_TESTS) ; then \
282          echo 'One or more tests contain non-portable "export VAR=val" syntax' ; \
283          false ; \
284         fi
285
286 DIST_HOOKS += check-for-export-var-val
287
288 EXTRA_DIST += tests/OChangeLog
289 \f
290 # Autotest testsuite
291
292 EXTRA_DIST += \
293         tests/testsuite.in \
294         $(TESTSUITE_AT) \
295         $(TESTSUITE) \
296         tests/atlocal.in \
297         $(srcdir)/package.m4 \
298         $(TESTSUITE)
299
300 TESTSUITE_AT = \
301         tests/data/calendar.at \
302         tests/data/data-in.at \
303         tests/data/sys-file.at \
304         tests/language/command.at \
305         tests/language/control/do-if.at \
306         tests/language/control/do-repeat.at \
307         tests/language/control/loop.at \
308         tests/language/data-io/add-files.at \
309         tests/language/data-io/data-list.at \
310         tests/language/data-io/data-reader.at \
311         tests/language/data-io/file-handle.at \
312         tests/language/data-io/get-data-gnm.at \
313         tests/language/data-io/get-data-psql.at \
314         tests/language/data-io/get-data-txt.at \
315         tests/language/data-io/get.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'