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