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