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