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