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