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