sys-file-writer: Write identical sets of value labels only once.
[pspp] / tests / automake.mk
1 ## Process this file with automake to produce Makefile.in  -*- makefile -*-
2
3 check_PROGRAMS += \
4         tests/data/datasheet-test \
5         tests/data/sack \
6         tests/data/inexactify \
7         tests/language/lexer/command-name-test \
8         tests/language/lexer/scan-test \
9         tests/language/lexer/segment-test \
10         tests/libpspp/abt-test \
11         tests/libpspp/bt-test \
12         tests/libpspp/encoding-guesser-test \
13         tests/libpspp/heap-test \
14         tests/libpspp/hmap-test \
15         tests/libpspp/hmapx-test \
16         tests/libpspp/i18n-test \
17         tests/libpspp/ll-test \
18         tests/libpspp/llx-test \
19         tests/libpspp/range-map-test \
20         tests/libpspp/range-set-test \
21         tests/libpspp/sparse-array-test \
22         tests/libpspp/sparse-xarray-test \
23         tests/libpspp/str-test \
24         tests/libpspp/string-map-test \
25         tests/libpspp/stringi-map-test \
26         tests/libpspp/string-set-test \
27         tests/libpspp/stringi-set-test \
28         tests/libpspp/tower-test \
29         tests/libpspp/u8-istream-test \
30         tests/output/render-test
31
32 check-programs: $(check_PROGRAMS)
33
34 tests_data_datasheet_test_SOURCES = \
35         tests/data/datasheet-test.c
36 tests_data_datasheet_test_LDADD = src/libpspp-core.la
37 tests_data_datasheet_test_CFLAGS = $(AM_CFLAGS)
38
39 tests_data_sack_SOURCES = \
40         tests/data/sack.c
41 tests_data_sack_LDADD = src/libpspp-core.la 
42 tests_data_sack_CFLAGS = $(AM_CFLAGS)
43
44 tests_libpspp_ll_test_SOURCES = \
45         src/libpspp/ll.c \
46         tests/libpspp/ll-test.c
47 tests_libpspp_ll_test_CFLAGS = $(AM_CFLAGS)
48
49 tests_libpspp_llx_test_SOURCES = \
50         src/libpspp/ll.c \
51         src/libpspp/llx.c \
52         tests/libpspp/llx-test.c
53 tests_libpspp_llx_test_CFLAGS = $(AM_CFLAGS)
54
55 tests_libpspp_encoding_guesser_test_SOURCES = \
56         tests/libpspp/encoding-guesser-test.c
57 tests_libpspp_encoding_guesser_test_LDADD = src/libpspp/libpspp.la gl/libgl.la
58
59 tests_libpspp_heap_test_SOURCES = \
60         src/libpspp/heap.c \
61         src/libpspp/pool.c \
62         src/libpspp/temp-file.c \
63         tests/libpspp/heap-test.c
64 tests_libpspp_heap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
65
66 tests_libpspp_hmap_test_SOURCES = \
67         src/libpspp/hmap.c \
68         tests/libpspp/hmap-test.c
69 tests_libpspp_hmap_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
70
71 tests_libpspp_hmapx_test_SOURCES = \
72         src/libpspp/hmap.c \
73         src/libpspp/hmapx.c \
74         tests/libpspp/hmapx-test.c
75 tests_libpspp_hmapx_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
76
77 tests_libpspp_i18n_test_SOURCES = tests/libpspp/i18n-test.c
78 tests_libpspp_i18n_test_LDADD = src/libpspp/libpspp.la gl/libgl.la 
79
80 tests_libpspp_abt_test_SOURCES = \
81         src/libpspp/abt.c \
82         tests/libpspp/abt-test.c
83 tests_libpspp_abt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
84
85 tests_libpspp_bt_test_SOURCES = \
86         src/libpspp/bt.c \
87         tests/libpspp/bt-test.c
88 tests_libpspp_bt_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
89
90 tests_libpspp_range_map_test_SOURCES = \
91         src/libpspp/bt.c \
92         src/libpspp/range-map.c \
93         tests/libpspp/range-map-test.c
94 tests_libpspp_range_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
95
96 tests_libpspp_range_set_test_SOURCES = \
97         src/libpspp/bt.c \
98         src/libpspp/pool.c \
99         src/libpspp/range-set.c \
100         src/libpspp/temp-file.c \
101         tests/libpspp/range-set-test.c
102 tests_libpspp_range_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
103
104 tests_libpspp_str_test_SOURCES = \
105         tests/libpspp/str-test.c
106 tests_libpspp_str_test_LDADD = src/libpspp/libpspp.la gl/libgl.la 
107
108 tests_libpspp_string_map_test_SOURCES = \
109         src/libpspp/hash-functions.c \
110         src/libpspp/hmap.c \
111         src/libpspp/string-map.c \
112         src/libpspp/string-set.c \
113         tests/libpspp/string-map-test.c
114 tests_libpspp_string_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
115
116 tests_libpspp_stringi_map_test_SOURCES = \
117         src/libpspp/hash-functions.c \
118         src/libpspp/hmap.c \
119         src/libpspp/pool.c \
120         src/libpspp/str.c \
121         src/libpspp/stringi-map.c \
122         src/libpspp/string-set.c \
123         src/libpspp/stringi-set.c \
124         src/libpspp/temp-file.c \
125         tests/libpspp/stringi-map-test.c
126 tests_libpspp_stringi_map_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
127
128 tests_libpspp_string_set_test_SOURCES = \
129         src/libpspp/hash-functions.c \
130         src/libpspp/hmap.c \
131         src/libpspp/string-set.c \
132         tests/libpspp/string-set-test.c
133 tests_libpspp_string_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
134
135 tests_libpspp_stringi_set_test_SOURCES = \
136         src/libpspp/hash-functions.c \
137         src/libpspp/hmap.c \
138         src/libpspp/pool.c \
139         src/libpspp/str.c \
140         src/libpspp/stringi-set.c \
141         src/libpspp/temp-file.c \
142         tests/libpspp/stringi-set-test.c
143 tests_libpspp_stringi_set_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
144
145 tests_libpspp_tower_test_SOURCES = \
146         src/libpspp/abt.c \
147         src/libpspp/pool.c \
148         src/libpspp/temp-file.c \
149         src/libpspp/tower.c \
150         tests/libpspp/tower-test.c
151 tests_libpspp_tower_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
152
153 tests_libpspp_u8_istream_test_SOURCES = tests/libpspp/u8-istream-test.c
154 tests_libpspp_u8_istream_test_LDADD = src/libpspp/libpspp.la gl/libgl.la
155
156 tests_libpspp_sparse_array_test_SOURCES = \
157         src/libpspp/sparse-array.c \
158         src/libpspp/pool.c \
159         tests/libpspp/sparse-array-test.c \
160         src/libpspp/temp-file.c
161 tests_libpspp_sparse_array_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
162
163 tests_libpspp_sparse_xarray_test_SOURCES = \
164         src/libpspp/argv-parser.c \
165         src/libpspp/bt.c \
166         src/libpspp/deque.c \
167         src/libpspp/ext-array.c \
168         src/libpspp/model-checker.c \
169         src/libpspp/range-set.c \
170         src/libpspp/sparse-array.c \
171         src/libpspp/sparse-xarray.c \
172         src/libpspp/str.c \
173         src/libpspp/pool.c \
174         src/libpspp/temp-file.c \
175         tests/libpspp/sparse-xarray-test.c
176 tests_libpspp_sparse_xarray_test_CPPFLAGS = $(AM_CPPFLAGS) -DASSERT_LEVEL=10
177
178 tests_data_inexactify_SOURCES = tests/data/inexactify.c
179
180 check_PROGRAMS += tests/language/lexer/command-name-test
181 tests_language_lexer_command_name_test_SOURCES = \
182         src/data/identifier.c \
183         src/language/lexer/command-name.c \
184         tests/language/lexer/command-name-test.c
185 tests_language_lexer_command_name_test_LDADD = \
186         src/libpspp/libpspp.la \
187         gl/libgl.la 
188 tests_language_lexer_command_name_test_CFLAGS = $(AM_CFLAGS)
189
190 check_PROGRAMS += tests/language/lexer/scan-test
191 tests_language_lexer_scan_test_SOURCES = \
192         src/data/identifier.c \
193         src/language/lexer/command-name.c \
194         src/language/lexer/scan.c \
195         src/language/lexer/segment.c \
196         src/language/lexer/token.c \
197         src/libpspp/pool.c \
198         src/libpspp/prompt.c \
199         src/libpspp/str.c \
200         src/libpspp/temp-file.c \
201         tests/language/lexer/scan-test.c
202 tests_language_lexer_scan_test_CFLAGS = $(AM_CFLAGS)
203
204 check_PROGRAMS += tests/language/lexer/segment-test
205 tests_language_lexer_segment_test_SOURCES = \
206         src/data/identifier.c \
207         src/language/lexer/command-name.c \
208         src/language/lexer/segment.c \
209         src/libpspp/pool.c \
210         src/libpspp/prompt.c \
211         src/libpspp/str.c \
212         src/libpspp/temp-file.c \
213         tests/language/lexer/segment-test.c
214 tests_language_lexer_segment_test_CFLAGS = $(AM_CFLAGS)
215
216 check_PROGRAMS += tests/output/render-test
217 tests_output_render_test_SOURCES = tests/output/render-test.c
218 tests_output_render_test_LDADD = \
219         src/libpspp.la \
220         src/libpspp-core.la \
221         $(CAIRO_LIBS)
222
223 EXTRA_DIST += \
224         tests/coverage.sh \
225         tests/data/bcd-in.expected.cmp.gz \
226         tests/data/binhex-in.expected.cmp.gz \
227         tests/data/binhex-out.expected.gz \
228         tests/data/legacy-in.expected.cmp.gz \
229         tests/data/num-in.expected.gz \
230         tests/data/num-out-cmp.pl \
231         tests/data/num-out.expected.cmp.gz \
232         tests/data/v13.sav \
233         tests/data/v14.sav \
234         tests/language/data-io/Book1.gnm.unzipped
235
236 CLEANFILES += *.save pspp.* foo*
237
238 EXTRA_DIST += tests/OChangeLog
239 \f
240 # Autotest testsuite
241
242 EXTRA_DIST += \
243         tests/testsuite.in \
244         $(TESTSUITE_AT) \
245         $(TESTSUITE) \
246         tests/atlocal.in \
247         $(srcdir)/package.m4 \
248         $(TESTSUITE)
249
250 TESTSUITE_AT = \
251         tests/data/calendar.at \
252         tests/data/data-in.at \
253         tests/data/data-out.at \
254         tests/data/datasheet-test.at \
255         tests/data/format-guesser.at \
256         tests/data/por-file.at \
257         tests/data/sys-file-reader.at \
258         tests/data/sys-file.at \
259         tests/language/command.at \
260         tests/language/control/do-if.at \
261         tests/language/control/do-repeat.at \
262         tests/language/control/loop.at \
263         tests/language/control/temporary.at \
264         tests/language/data-io/add-files.at \
265         tests/language/data-io/data-list.at \
266         tests/language/data-io/data-reader.at \
267         tests/language/data-io/dataset.at \
268         tests/language/data-io/file-handle.at \
269         tests/language/data-io/get-data-gnm.at \
270         tests/language/data-io/get-data-psql.at \
271         tests/language/data-io/get-data-txt.at \
272         tests/language/data-io/get.at \
273         tests/language/data-io/inpt-pgm.at \
274         tests/language/data-io/list.at \
275         tests/language/data-io/match-files.at \
276         tests/language/data-io/print-space.at \
277         tests/language/data-io/print.at \
278         tests/language/data-io/save.at \
279         tests/language/data-io/save-translate.at \
280         tests/language/data-io/update.at \
281         tests/language/dictionary/attributes.at \
282         tests/language/dictionary/formats.at \
283         tests/language/dictionary/missing-values.at \
284         tests/language/dictionary/mrsets.at \
285         tests/language/dictionary/rename-variables.at \
286         tests/language/dictionary/split-file.at \
287         tests/language/dictionary/sys-file-info.at \
288         tests/language/dictionary/value-labels.at \
289         tests/language/dictionary/variable-display.at \
290         tests/language/dictionary/vector.at \
291         tests/language/dictionary/weight.at \
292         tests/language/expressions/evaluate.at \
293         tests/language/expressions/parse.at \
294         tests/language/lexer/command-name.at \
295         tests/language/lexer/lexer.at \
296         tests/language/lexer/q2c.at \
297         tests/language/lexer/scan.at \
298         tests/language/lexer/segment.at \
299         tests/language/lexer/variable-parser.at \
300         tests/language/stats/aggregate.at \
301         tests/language/stats/autorecode.at \
302         tests/language/stats/correlations.at \
303         tests/language/stats/crosstabs.at \
304         tests/language/stats/descriptives.at \
305         tests/language/stats/examine.at \
306         tests/language/stats/factor.at \
307         tests/language/stats/flip.at \
308         tests/language/stats/frequencies.at \
309         tests/language/stats/npar.at \
310         tests/language/stats/oneway.at \
311         tests/language/stats/quick-cluster.at \
312         tests/language/stats/rank.at \
313         tests/language/stats/regression.at \
314         tests/language/stats/reliability.at \
315         tests/language/stats/roc.at \
316         tests/language/stats/sort-cases.at \
317         tests/language/stats/t-test.at \
318         tests/language/utilities/cache.at \
319         tests/language/utilities/cd.at \
320         tests/language/utilities/date.at \
321         tests/language/utilities/insert.at \
322         tests/language/utilities/permissions.at \
323         tests/language/utilities/set.at \
324         tests/language/utilities/title.at \
325         tests/language/xforms/compute.at \
326         tests/language/xforms/count.at \
327         tests/language/xforms/recode.at \
328         tests/language/xforms/sample.at \
329         tests/language/xforms/select-if.at \
330         tests/libpspp/abt.at \
331         tests/libpspp/bt.at \
332         tests/libpspp/encoding-guesser.at \
333         tests/libpspp/float-format.at \
334         tests/libpspp/heap.at \
335         tests/libpspp/hmap.at \
336         tests/libpspp/hmapx.at \
337         tests/libpspp/i18n.at \
338         tests/libpspp/ll.at \
339         tests/libpspp/llx.at \
340         tests/libpspp/range-map.at \
341         tests/libpspp/range-set.at \
342         tests/libpspp/sparse-array.at \
343         tests/libpspp/sparse-xarray-test.at \
344         tests/libpspp/str.at \
345         tests/libpspp/string-map.at \
346         tests/libpspp/stringi-map.at \
347         tests/libpspp/string-set.at \
348         tests/libpspp/stringi-set.at \
349         tests/libpspp/tower.at \
350         tests/libpspp/u8-istream.at \
351         tests/math/moments.at \
352         tests/math/randist.at \
353         tests/output/ascii.at \
354         tests/output/charts.at \
355         tests/output/output.at \
356         tests/output/paper-size.at \
357         tests/output/render.at \
358         tests/ui/terminal/main.at \
359         tests/perl-module.at
360
361 TESTSUITE = $(srcdir)/tests/testsuite
362 DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
363 AUTOTEST_PATH = tests/data:tests/language/lexer:tests/libpspp:tests/output:src/ui/terminal
364
365 $(srcdir)/tests/testsuite.at: tests/testsuite.in tests/automake.mk
366         cp $< $@
367         for t in $(TESTSUITE_AT); do \
368           echo "m4_include([$$t])" >> $@ ;\
369         done
370 EXTRA_DIST += tests/testsuite.at
371
372 CHECK_LOCAL += tests_check
373 tests_check: tests/atconfig tests/atlocal $(TESTSUITE) $(check_PROGRAMS)
374         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
375
376 CLEAN_LOCAL += tests_clean
377 tests_clean:
378         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
379
380 AUTOM4TE = $(SHELL) $(srcdir)/build-aux/missing --run autom4te
381 AUTOTEST = $(AUTOM4TE) --language=autotest
382 $(TESTSUITE): package.m4 $(srcdir)/tests/testsuite.at $(TESTSUITE_AT) 
383         $(AUTOTEST) -I '$(srcdir)' $@.at | sed 's/@<00A0>@/ /g' > $@.tmp
384         mv $@.tmp $@
385
386 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
387 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
388         :;{ \
389           echo '# Signature of the current package.' && \
390           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
391           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
392           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
393           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
394           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])' && \
395           echo 'm4_define([AT_PACKAGE_URL],       [$(PACKAGE_URL)])'; \
396         } >'$(srcdir)/package.m4'
397 \f
398 # valgrind support for Autotest testsuite
399
400 valgrind_wrappers = \
401         tests/valgrind/datasheet-test \
402         tests/valgrind/command-name-test \
403         tests/valgrind/scan-test \
404         tests/valgrind/segment-test \
405         tests/valgrind/abt-test \
406         tests/valgrind/bt-test \
407         tests/valgrind/encoding-guesser-test \
408         tests/valgrind/heap-test \
409         tests/valgrind/hmap-test \
410         tests/valgrind/hmapx-test \
411         tests/valgrind/i18n-test \
412         tests/valgrind/ll-test \
413         tests/valgrind/llx-test \
414         tests/valgrind/range-map-test \
415         tests/valgrind/range-set-test \
416         tests/valgrind/sparse-array-test \
417         tests/valgrind/sparse-xarray-test \
418         tests/valgrind/str-test \
419         tests/valgrind/string-map-test \
420         tests/valgrind/stringi-map-test \
421         tests/valgrind/string-set-test \
422         tests/valgrind/stringi-set-test \
423         tests/valgrind/tower-test \
424         tests/valgrind/u8-istream-test \
425         tests/valgrind/render-test \
426         tests/valgrind/pspp
427
428 $(valgrind_wrappers): tests/valgrind-wrapper.in
429         @test -d tests/valgrind || mkdir tests/valgrind
430         sed -e 's,[@]wrap_program[@],$@,' \
431                 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
432         chmod +x $@.tmp
433         mv $@.tmp $@
434 CLEANFILES += $(valgrind_wrappers)
435 EXTRA_DIST += tests/valgrind-wrapper.in
436
437 VALGRIND = $(SHELL) $(abs_top_builddir)/libtool --mode=execute valgrind --log-file=valgrind.%p --leak-check=full --num-callers=20
438 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) $(valgrind_wrappers)
439         $(SHELL) '$(TESTSUITE)' -C tests VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
440         @echo
441         @echo '--------------------------------'
442         @echo 'Valgrind output is in:'
443         @echo 'tests/testsuite.dir/*/valgrind.*'
444         @echo '--------------------------------'