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 \
25 check-multi check-multi-glass \
26 check-remote check-remoteprog check-remotetcp \
27 check-remoteprog-glass \
28 check-remotetcp-glass \
29 up remove-cached-databases
34 check-none: apitest$(EXEEXT) \
35 internaltest$(EXEEXT) \
38 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b none
39 $(TESTS_ENVIRONMENT) ./internaltest$(EXEEXT)
40 $(TESTS_ENVIRONMENT) ./stemtest$(EXEEXT)
41 $(TESTS_ENVIRONMENT) ./unittest$(EXEEXT)
43 check-inmemory: apitest$(EXEEXT)
44 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b inmemory
46 check-multi: apitest$(EXEEXT)
47 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi
49 check-singlefile: apitest$(EXEEXT)
50 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b singlefile
52 if BUILD_BACKEND_REMOTE
53 check-remote: check-remoteprog check-remotetcp
55 check-remoteprog: apitest$(EXEEXT)
56 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog
58 check-remotetcp: apitest$(EXEEXT)
59 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp
61 if BUILD_BACKEND_GLASS
62 check-remoteprog-glass: apitest$(EXEEXT)
63 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remoteprog_glass
64 check-remotetcp-glass: apitest$(EXEEXT)
65 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b remotetcp_glass
70 if BUILD_BACKEND_GLASS
71 check-multi-glass: apitest$(EXEEXT)
72 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b multi_glass
73 check-glass: apitest$(EXEEXT)
74 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b glass
75 check-singlefile-glass: apitest$(EXEEXT)
76 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b singlefile_glass
79 if BUILD_BACKEND_HONEY
80 check-honey: apitest$(EXEEXT)
81 $(TESTS_ENVIRONMENT) ./apitest$(EXEEXT) -b honey
84 ## Test programs to be run
85 TESTS = apitest$(EXEEXT) internaltest$(EXEEXT) stemtest$(EXEEXT) \
90 apitest internaltest stemtest unittest
92 # Make sure runtest is up to date before running tests
93 check_SCRIPTS = runtest
97 noinst_HEADERS = apitest.h dbcheck.h
99 collated_apitest_sources = \
117 api_postingsource.cc \
137 apitest_SOURCES = apitest.cc dbcheck.cc $(collated_apitest_sources) \
138 api_all.h api_collated.h $(testharness_sources)
140 apitest_LDFLAGS = $(NO_INSTALL) $(ldflags)
141 apitest_LDADD = ../libgetopt.la ../$(libxapian_la)
143 stemtest_SOURCES = stemtest.cc $(testharness_sources)
144 stemtest_LDFLAGS = $(NO_INSTALL) $(ldflags)
145 stemtest_LDADD = ../libgetopt.la ../$(libxapian_la)
147 internaltest_SOURCES = internaltest.cc $(testharness_sources)
148 internaltest_LDFLAGS = $(NO_INSTALL) $(ldflags)
149 internaltest_LDADD = ../libgetopt.la ../$(libxapian_la)
151 unittest_SOURCES = unittest.cc $(utestharness_sources)
152 unittest_LDFLAGS = $(NO_INSTALL) $(ldflags)
153 unittest_LDADD = ../libgetopt.la $(XAPIAN_LIBS)
158 BUILT_SOURCES += api_all.h api_collated.h $(collated_apitest_sources:.cc=.h) \
161 api_all.h api_collated.h $(collated_apitest_sources:.cc=.h): api_collated.stamp
162 ## Recover from the removal of $@. A full explanation of these rules is in the
163 ## automake manual under the heading "Multiple Outputs".
164 @if test -f $@; then :; else \
165 trap 'rm -rf api_collated.lock api_collated.stamp' 1 2 13 15; \
166 if mkdir api_collated.lock 2>/dev/null; then \
167 rm -f api_collated.stamp; \
168 $(MAKE) $(AM_MAKEFLAGS) api_collated.stamp; \
169 rmdir api_collated.lock; \
171 while test -d api_collated.lock; do sleep 1; done; \
172 test -f api_collated.stamp; exit $$?; \
175 api_collated.stamp: $(collated_apitest_sources) collate-test Makefile.am
176 $(PERL) "$(srcdir)/collate-test" "$(srcdir)" api_collated.h api_all.h $(collated_apitest_sources)
179 api_generated.cc: generate-api_generated
180 $(PERL) "$(srcdir)/generate-api_generated" > api_generated.ccT
181 mv api_generated.ccT api_generated.cc
184 EXTRA_DIST = collate-test generate-api_generated api_all.h api_collated.h \
185 $(collated_apitest_sources:.cc=.h)
187 ## Distribute test data:
191 testdata/apitest_onedoc.txt \
192 testdata/apitest_simpledata.txt \
193 testdata/apitest_simpledata2.txt \
194 testdata/apitest_termorder.txt \
195 testdata/apitest_rset.txt \
196 testdata/apitest_phrase.txt \
197 testdata/apitest_punc.txt \
198 testdata/apitest_space.txt \
199 testdata/apitest_allterms.txt \
200 testdata/apitest_allterms2.txt \
201 testdata/apitest_allterms4.txt \
202 testdata/apitest_poslist.txt \
203 testdata/apitest_manydocs.txt \
204 testdata/apitest_sortconsist.txt \
205 testdata/apitest_sortrel.txt \
206 testdata/apitest_declen.txt \
210 remove-cached-databases:
211 rm -rf .glass .honey .multiglass .replicatmp .singlefileglass .stub
213 clean-local: remove-cached-databases
215 # Remove the cached databases before "make check" to avoid issues with missing
216 # bugs in database creation when we reuse databases from a previous test run.
217 check: remove-cached-databases
219 include harness/Makefile.mk
220 include perftest/Makefile.mk
221 include soaktest/Makefile.mk
223 EXTRA_DIST += zlib-vg.c
225 check_SCRIPTS += zlib-vg.so
226 CLEANFILES += zlib-vg.so
228 zlib-vg.so: zlib-vg.c
229 $(CC) -fPIC -shared -o zlib-vg.so $(srcdir)/zlib-vg.c -ldl
236 $(CXXCOMPILE) -fsyntax-only -gstabs+ $(CHK_SOURCES)