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 \
23 check-chert check-glass \
24 check-multi check-multi-chert check-multi-glass \
25 check-remote check-remoteprog check-remotetcp \
26 check-remoteprog-chert check-remoteprog-glass \
27 check-remotetcp-chert 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 ## If both chert and glass are enabled, just run remoteprog_chert.
56 if BUILD_BACKEND_CHERT
57 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_chert
59 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog
62 check-remotetcp: apitest$(EXEEXT)
63 ## If both chert and glass are enabled, just run remotetcp_glass.
64 if BUILD_BACKEND_GLASS
65 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_glass
67 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp
70 if BUILD_BACKEND_GLASS
71 check-remoteprog-glass: apitest$(EXEEXT)
72 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_glass
73 check-remotetcp-glass: apitest$(EXEEXT)
74 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_glass
77 if BUILD_BACKEND_CHERT
78 check-remoteprog-chert: apitest$(EXEEXT)
79 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_chert
80 check-remotetcp-chert: apitest$(EXEEXT)
81 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_chert
85 if BUILD_BACKEND_GLASS
86 check-multi-glass: apitest$(EXEEXT)
87 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi_glass
88 check-glass: apitest$(EXEEXT)
89 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b glass
90 check-singlefile-glass: apitest$(EXEEXT)
91 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b singlefile_glass
94 if BUILD_BACKEND_CHERT
95 check-multi-chert: apitest$(EXEEXT)
96 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi_chert
97 check-chert: apitest$(EXEEXT)
98 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b chert
101 ## Test programs to be run
102 TESTS = apitest$(EXEEXT) internaltest$(EXEEXT) stemtest$(EXEEXT) \
107 apitest internaltest stemtest unittest
109 # Make sure runtest is up to date before running tests
110 check_SCRIPTS = runtest
114 noinst_HEADERS = apitest.h dbcheck.h
116 collated_apitest_sources = \
134 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 unittest_SOURCES = unittest.cc $(utestharness_sources)
169 unittest_LDFLAGS = $(NO_INSTALL) $(ldflags)
170 unittest_LDADD = ../libgetopt.la $(XAPIAN_LIBS)
175 BUILT_SOURCES += api_all.h api_collated.h $(collated_apitest_sources:.cc=.h) \
176 api_collated.stamp api_generated.cc
178 api_all.h api_collated.h $(collated_apitest_sources:.cc=.h): api_collated.stamp
179 ## Recover from the removal of $@. A full explanation of these rules is in the
180 ## automake manual under the heading "Multiple Outputs".
181 @if test -f $@; then :; else \
182 trap 'rm -rf api_collated.lock api_collated.stamp' 1 2 13 15; \
183 if mkdir api_collated.lock 2>/dev/null; then \
184 rm -f api_collated.stamp; \
185 $(MAKE) $(AM_MAKEFLAGS) api_collated.stamp; \
186 rmdir api_collated.lock; \
188 while test -d api_collated.lock; do sleep 1; done; \
189 test -f api_collated.stamp; exit $$?; \
192 api_collated.stamp: $(collated_apitest_sources) collate-test Makefile.am
193 $(PERL) "$(srcdir)/collate-test" "$(srcdir)" api_collated.h api_all.h $(collated_apitest_sources)
196 api_generated.cc: generate-api_generated
197 $(PERL) "$(srcdir)/generate-api_generated" > api_generated.ccT
198 mv api_generated.ccT api_generated.cc
201 EXTRA_DIST = collate-test generate-api_generated api_all.h api_collated.h \
202 $(collated_apitest_sources:.cc=.h) api_collated.stamp
204 ## Distribute test data:
208 testdata/apitest_onedoc.txt \
209 testdata/apitest_simpledata.txt \
210 testdata/apitest_simpledata2.txt \
211 testdata/apitest_termorder.txt \
212 testdata/apitest_rset.txt \
213 testdata/apitest_phrase.txt \
214 testdata/apitest_punc.txt \
215 testdata/apitest_space.txt \
216 testdata/apitest_allterms.txt \
217 testdata/apitest_allterms2.txt \
218 testdata/apitest_allterms4.txt \
219 testdata/apitest_poslist.txt \
220 testdata/apitest_manydocs.txt \
221 testdata/apitest_sortconsist.txt \
222 testdata/apitest_sortrel.txt \
223 testdata/apitest_declen.txt \
225 testdata/phraseweightcheckbug1.txt \
228 remove-cached-databases:
229 rm -rf .chert .glass .multichert .multiglass \
230 .multiglassremoteprog_glass .multiremoteprog_glass \
231 .replicatmp .singlefileglass .stub
233 clean-local: remove-cached-databases
235 # Remove the cached databases before "make check" to avoid issues with missing
236 # bugs in database creation when we reuse databases from a previous test run.
237 check: remove-cached-databases
239 include harness/Makefile.mk
240 include perftest/Makefile.mk
241 include soaktest/Makefile.mk
243 EXTRA_DIST += zlib-vg.c
245 check_SCRIPTS += zlib-vg.so
246 CLEANFILES += zlib-vg.so
248 zlib-vg.so: zlib-vg.c
249 $(CC) -fPIC -shared -o zlib-vg.so $(srcdir)/zlib-vg.c -ldl
254 MAINTAINERCLEANFILES = $(BUILT_SOURCES)
257 $(CXXCOMPILE) -fsyntax-only -gstabs+ $(CHK_SOURCES)