1 ## Process this file with automake to produce Makefile.in
3 AUTOMAKE_OPTIONS = 1.12.2 serial-tests subdir-objects
6 # Export these so that we run the locally installed autotools when building
7 # from a bootstrapped git tree.
8 export ACLOCAL AUTOCONF AUTOHEADER AUTOM4TE AUTOMAKE
11 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/include \
12 -I$(top_builddir)/include -I$(srcdir)/harness
14 # If tests are run under valgrind and the test is killed at the wrong moment
15 # then a log file is left behind.
16 CLEANFILES = .valgrind.log.*
18 libxapian_la = libxapian@LIBRARY_VERSION_SUFFIX@.la
20 TESTS_ENVIRONMENT = ./runtest
22 .PHONY: check-none check-inmemory \
24 check-multi check-multi-glass \
25 check-remote check-remoteprog check-remotetcp \
26 check-remoteprog-glass \
27 check-remotetcp-glass \
28 up remove-cached-databases
33 check-none: apitest$(EXEEXT) \
34 internaltest$(EXEEXT) \
37 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b none
38 $(TESTS_ENVIRONMENT) ./internaltest$(EXEEXT)
39 $(TESTS_ENVIRONMENT) ./stemtest$(EXEEXT)
40 $(TESTS_ENVIRONMENT) ./unittest$(EXEEXT)
42 check-inmemory: apitest$(EXEEXT)
43 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b inmemory
45 check-multi: apitest$(EXEEXT)
46 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi
48 check-singlefile: apitest$(EXEEXT)
49 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b singlefile
51 if BUILD_BACKEND_REMOTE
52 check-remote: check-remoteprog check-remotetcp
54 check-remoteprog: apitest$(EXEEXT)
55 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog
57 check-remotetcp: apitest$(EXEEXT)
58 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp
60 if BUILD_BACKEND_GLASS
61 check-remoteprog-glass: apitest$(EXEEXT)
62 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_glass
63 check-remotetcp-glass: apitest$(EXEEXT)
64 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_glass
69 if BUILD_BACKEND_GLASS
70 check-multi-glass: apitest$(EXEEXT)
71 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi_glass
72 check-glass: apitest$(EXEEXT)
73 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b glass
74 check-singlefile-glass: apitest$(EXEEXT)
75 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b singlefile_glass
78 ## Test programs to be run
79 TESTS = apitest$(EXEEXT) internaltest$(EXEEXT) stemtest$(EXEEXT) \
84 apitest internaltest stemtest unittest
86 # Make sure runtest is up to date before running tests
87 check_SCRIPTS = runtest
91 noinst_HEADERS = apitest.h dbcheck.h
93 collated_apitest_sources = \
111 api_postingsource.cc \
131 apitest_SOURCES = apitest.cc dbcheck.cc $(collated_apitest_sources) \
132 api_all.h api_collated.h $(testharness_sources)
134 apitest_LDFLAGS = $(NO_INSTALL) $(ldflags)
135 apitest_LDADD = ../libgetopt.la ../$(libxapian_la)
137 stemtest_SOURCES = stemtest.cc $(testharness_sources)
138 stemtest_LDFLAGS = $(NO_INSTALL) $(ldflags)
139 stemtest_LDADD = ../libgetopt.la ../$(libxapian_la)
141 internaltest_SOURCES = internaltest.cc $(testharness_sources)
142 internaltest_LDFLAGS = $(NO_INSTALL) $(ldflags)
143 internaltest_LDADD = ../libgetopt.la ../$(libxapian_la)
145 unittest_SOURCES = unittest.cc $(utestharness_sources)
146 unittest_LDFLAGS = $(NO_INSTALL) $(ldflags)
147 unittest_LDADD = ../libgetopt.la
152 BUILT_SOURCES += api_all.h api_collated.h $(collated_apitest_sources:.cc=.h) \
155 api_all.h api_collated.h $(collated_apitest_sources:.cc=.h): api_collated.stamp
156 ## Recover from the removal of $@. A full explanation of these rules is in the
157 ## automake manual under the heading "Multiple Outputs".
158 @if test -f $@; then :; else \
159 trap 'rm -rf api_collated.lock api_collated.stamp' 1 2 13 15; \
160 if mkdir api_collated.lock 2>/dev/null; then \
161 rm -f api_collated.stamp; \
162 $(MAKE) $(AM_MAKEFLAGS) api_collated.stamp; \
163 rmdir api_collated.lock; \
165 while test -d api_collated.lock; do sleep 1; done; \
166 test -f api_collated.stamp; exit $$?; \
169 api_collated.stamp: $(collated_apitest_sources) collate-test Makefile.am
170 $(PERL) "$(srcdir)/collate-test" "$(srcdir)" api_collated.h api_all.h $(collated_apitest_sources)
173 api_generated.cc: generate-api_generated
174 $(PERL) "$(srcdir)/generate-api_generated" > api_generated.ccT
175 mv api_generated.ccT api_generated.cc
178 EXTRA_DIST = collate-test generate-api_generated api_all.h api_collated.h \
179 $(collated_apitest_sources:.cc=.h)
181 ## Distribute test data:
185 testdata/apitest_onedoc.txt \
186 testdata/apitest_simpledata.txt \
187 testdata/apitest_simpledata2.txt \
188 testdata/apitest_termorder.txt \
189 testdata/apitest_rset.txt \
190 testdata/apitest_phrase.txt \
191 testdata/apitest_punc.txt \
192 testdata/apitest_space.txt \
193 testdata/apitest_allterms.txt \
194 testdata/apitest_allterms2.txt \
195 testdata/apitest_allterms4.txt \
196 testdata/apitest_poslist.txt \
197 testdata/apitest_manydocs.txt \
198 testdata/apitest_sortconsist.txt \
199 testdata/apitest_sortrel.txt \
200 testdata/apitest_declen.txt \
204 remove-cached-databases:
205 rm -rf .glass .multiglass .replicatmp .singlefileglass .stub
207 clean-local: remove-cached-databases
209 # Remove the cached databases before "make check" to avoid issues with missing
210 # bugs in database creation when we reuse databases from a previous test run.
211 check: remove-cached-databases
213 include harness/Makefile.mk
214 include perftest/Makefile.mk
215 include soaktest/Makefile.mk
217 EXTRA_DIST += zlib-vg.c
219 check_SCRIPTS += zlib-vg.so
220 CLEANFILES += zlib-vg.so
222 zlib-vg.so: zlib-vg.c
223 $(CC) -fPIC -shared -o zlib-vg.so $(srcdir)/zlib-vg.c -ldl
230 $(CXXCOMPILE) -fsyntax-only -gstabs+ $(CHK_SOURCES)