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