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
16 libxapian_la = libxapian@LIBRARY_VERSION_SUFFIX@.la
18 TESTS_ENVIRONMENT = ./runtest
20 .PHONY: check-none check-inmemory \
21 check-chert check-glass \
22 check-multi check-multi-chert check-multi-glass \
23 check-remote check-remoteprog check-remotetcp \
24 check-remoteprog-chert check-remoteprog-glass \
25 check-remotetcp-chert check-remotetcp-glass \
26 up remove-cached-databases
31 check-none: apitest$(EXEEXT) \
32 internaltest$(EXEEXT) \
34 queryparsertest$(EXEEXT) \
35 termgentest$(EXEEXT) \
37 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b none
38 $(TESTS_ENVIRONMENT) ./internaltest$(EXEEXT)
39 $(TESTS_ENVIRONMENT) ./stemtest$(EXEEXT)
40 $(TESTS_ENVIRONMENT) ./queryparsertest$(EXEEXT)
41 $(TESTS_ENVIRONMENT) ./termgentest$(EXEEXT)
42 $(TESTS_ENVIRONMENT) ./unittest$(EXEEXT)
44 check-inmemory: apitest$(EXEEXT)
45 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b inmemory
47 check-multi: apitest$(EXEEXT)
48 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi
50 check-singlefile: apitest$(EXEEXT)
51 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b singlefile
53 if BUILD_BACKEND_REMOTE
54 check-remote: check-remoteprog check-remotetcp
56 check-remoteprog: apitest$(EXEEXT)
57 ## If both chert and glass are enabled, just run remoteprog_chert.
58 if BUILD_BACKEND_CHERT
59 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_chert
61 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog
64 check-remotetcp: apitest$(EXEEXT)
65 ## If both chert and glass are enabled, just run remotetcp_glass.
66 if BUILD_BACKEND_GLASS
67 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_glass
69 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp
72 if BUILD_BACKEND_GLASS
73 check-remoteprog-glass: apitest$(EXEEXT)
74 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_glass
75 check-remotetcp-glass: apitest$(EXEEXT)
76 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_glass
79 if BUILD_BACKEND_CHERT
80 check-remoteprog-chert: apitest$(EXEEXT)
81 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_chert
82 check-remotetcp-chert: apitest$(EXEEXT)
83 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_chert
87 if BUILD_BACKEND_GLASS
88 check-multi-glass: apitest$(EXEEXT)
89 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi_glass
90 check-glass: apitest$(EXEEXT)
91 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b glass
92 check-singlefile-glass: apitest$(EXEEXT)
93 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b singlefile_glass
96 if BUILD_BACKEND_CHERT
97 check-multi-chert: apitest$(EXEEXT)
98 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi_chert
99 check-chert: apitest$(EXEEXT)
100 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b chert
103 ## Test programs to be run
104 TESTS = apitest$(EXEEXT) internaltest$(EXEEXT) stemtest$(EXEEXT) \
105 queryparsertest$(EXEEXT) termgentest$(EXEEXT) unittest$(EXEEXT)
109 apitest internaltest stemtest queryparsertest termgentest unittest
111 # Make sure runtest is up to date before running tests
112 check_SCRIPTS = runtest
116 noinst_HEADERS = apitest.h dbcheck.h
118 collated_apitest_sources = \
136 api_postingsource.cc \
154 apitest_SOURCES = apitest.cc dbcheck.cc $(collated_apitest_sources) \
155 api_all.h api_collated.h $(testharness_sources)
157 apitest_LDFLAGS = $(NO_INSTALL) $(ldflags)
158 apitest_LDADD = ../libgetopt.la ../$(libxapian_la)
160 stemtest_SOURCES = stemtest.cc $(testharness_sources)
161 stemtest_LDFLAGS = $(NO_INSTALL) $(ldflags)
162 stemtest_LDADD = ../libgetopt.la ../$(libxapian_la)
164 internaltest_SOURCES = internaltest.cc $(testharness_sources)
165 internaltest_LDFLAGS = $(NO_INSTALL) $(ldflags)
166 internaltest_LDADD = ../libgetopt.la ../$(libxapian_la)
168 queryparsertest_SOURCES = queryparsertest.cc $(testharness_sources)
169 queryparsertest_LDFLAGS = $(NO_INSTALL) $(ldflags)
170 queryparsertest_LDADD = ../libgetopt.la ../$(libxapian_la)
172 termgentest_SOURCES = termgentest.cc $(testharness_sources)
173 termgentest_LDFLAGS = $(NO_INSTALL) $(ldflags)
174 termgentest_LDADD = ../libgetopt.la ../$(libxapian_la)
176 unittest_SOURCES = unittest.cc $(utestharness_sources)
177 unittest_LDFLAGS = $(NO_INSTALL) $(ldflags)
178 unittest_LDADD = ../libgetopt.la
183 BUILT_SOURCES += api_all.h api_collated.h $(collated_apitest_sources:.cc=.h) \
186 api_all.h api_collated.h $(collated_apitest_sources:.cc=.h): api_collated.stamp
187 ## Recover from the removal of $@. A full explanation of these rules is in the
188 ## automake manual under the heading "Multiple Outputs".
189 @if test -f $@; then :; else \
190 trap 'rm -rf api_collated.lock api_collated.stamp' 1 2 13 15; \
191 if mkdir api_collated.lock 2>/dev/null; then \
192 rm -f api_collated.stamp; \
193 $(MAKE) $(AM_MAKEFLAGS) api_collated.stamp; \
194 rmdir api_collated.lock; \
196 while test -d api_collated.lock; do sleep 1; done; \
197 test -f api_collated.stamp; exit $$?; \
200 api_collated.stamp: $(collated_apitest_sources) collate-test Makefile.am
201 $(PERL) "$(srcdir)/collate-test" "$(srcdir)" api_collated.h api_all.h $(collated_apitest_sources)
204 api_generated.cc: generate-api_generated
205 $(PERL) "$(srcdir)/generate-api_generated" > api_generated.ccT
206 mv api_generated.ccT api_generated.cc
209 EXTRA_DIST = collate-test generate-api_generated api_all.h api_collated.h \
210 $(collated_apitest_sources:.cc=.h)
212 ## Distribute test data:
216 testdata/apitest_onedoc.txt \
217 testdata/apitest_simpledata.txt \
218 testdata/apitest_simpledata2.txt \
219 testdata/apitest_termorder.txt \
220 testdata/apitest_rset.txt \
221 testdata/apitest_phrase.txt \
222 testdata/apitest_punc.txt \
223 testdata/apitest_space.txt \
224 testdata/apitest_allterms.txt \
225 testdata/apitest_allterms2.txt \
226 testdata/apitest_allterms4.txt \
227 testdata/apitest_poslist.txt \
228 testdata/apitest_manydocs.txt \
229 testdata/apitest_sortconsist.txt \
230 testdata/apitest_sortrel.txt \
231 testdata/apitest_declen.txt \
234 remove-cached-databases:
235 rm -rf .chert .glass .multichert .multiglass .replicatmp .singlefileglass .stub
237 clean-local: remove-cached-databases
239 # Remove the cached databases before "make check" to avoid issues with missing
240 # bugs in database creation when we reuse databases from a previous test run.
241 check: remove-cached-databases
243 include harness/Makefile.mk
244 include perftest/Makefile.mk
245 include soaktest/Makefile.mk
247 EXTRA_DIST += zlib-vg.c
249 check_SCRIPTS += zlib-vg.so
250 CLEANFILES += zlib-vg.so
252 zlib-vg.so: zlib-vg.c
253 $(CC_FOR_BUILD) -fPIC -shared -o zlib-vg.so $(srcdir)/zlib-vg.c -ldl
260 $(CXXCOMPILE) -fsyntax-only -gstabs+ $(CHK_SOURCES)