3 # included from Top Level Makefile.am
4 # All paths should be given relative to the root
7 LIBTOOL_COMMAND= ${abs_top_builddir}/libtool --mode=execute
8 VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE
9 VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)
10 HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes
11 DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd
12 GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
13 PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=1
15 export LIBTOOL_COMMAND
16 export VALGRIND_COMMAND
17 export HELGRIND_COMMAND
22 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_EXEC_COMMAND)\""
25 @echo make check TESTS_ENVIRONMENT="\"$(GDB_COMMAND)\""
28 @echo make check TESTS_ENVIRONMENT="\"$(HELGRIND_COMMAND)\""
31 @echo make check TESTS_ENVIRONMENT="\"$(DRD_COMMAND)\""
33 EXTRA_DIST+= libtest/run.gdb
36 tmp_chroot/var/drizzle/* \
37 tmp_chroot/var/log/* \
38 tmp_chroot/var/run/* \
41 .PHONY: distclean-libtest-check
42 distclean-libtest-check:
45 noinst_HEADERS+= libtest/timer.hpp
49 libtest/blobslap_worker.h \
52 libtest/collection.h \
54 libtest/comparison.hpp \
67 libtest/is_local.hpp \
74 libtest/server_container.h \
84 libtest/visibility.h \
87 noinst_LTLIBRARIES+= libtest/libtest.la
89 libtest_libtest_la_CXXFLAGS=
90 libtest_libtest_la_DEPENDENCIES=
91 libtest_libtest_la_LIBADD=
92 libtest_libtest_la_SOURCES=
94 libtest_libtest_la_SOURCES+= libtest/binaries.cc
95 libtest_libtest_la_SOURCES+= libtest/cmdline.cc
96 libtest_libtest_la_SOURCES+= libtest/comparison.cc
97 libtest_libtest_la_SOURCES+= libtest/collection.cc
98 libtest_libtest_la_SOURCES+= libtest/core.cc
99 libtest_libtest_la_SOURCES+= libtest/cpu.cc
100 libtest_libtest_la_SOURCES+= libtest/dream.cc
101 libtest_libtest_la_SOURCES+= libtest/fatal.cc
102 libtest_libtest_la_SOURCES+= libtest/framework.cc
103 libtest_libtest_la_SOURCES+= libtest/has.cc
104 libtest_libtest_la_SOURCES+= libtest/drizzled.cc
105 libtest_libtest_la_SOURCES+= libtest/http.cc
106 libtest_libtest_la_SOURCES+= libtest/is_local.cc
107 libtest_libtest_la_SOURCES+= libtest/killpid.cc
108 libtest_libtest_la_SOURCES+= libtest/libtool.cc
109 libtest_libtest_la_SOURCES+= libtest/main.cc
110 libtest_libtest_la_SOURCES+= libtest/port.cc
111 libtest_libtest_la_SOURCES+= libtest/runner.cc
112 libtest_libtest_la_SOURCES+= libtest/server.cc
113 libtest_libtest_la_SOURCES+= libtest/server_container.cc
114 libtest_libtest_la_SOURCES+= libtest/signal.cc
115 libtest_libtest_la_SOURCES+= libtest/socket.cc
116 libtest_libtest_la_SOURCES+= libtest/stream.cc
117 libtest_libtest_la_SOURCES+= libtest/strerror.cc
118 libtest_libtest_la_SOURCES+= libtest/timer.cc
119 libtest_libtest_la_SOURCES+= libtest/tmpfile.cc
120 libtest_libtest_la_SOURCES+= libtest/vchar.cc
122 libtest_libtest_la_CXXFLAGS+= -DBUILDING_LIBTEST
123 libtest_libtest_la_CXXFLAGS+= $(PTHREAD_CFLAGS)
124 libtest_libtest_la_CXXFLAGS+= -DLIBTEST_TEMP="\"tmp_chroot\""
125 libtest_libtest_la_CXXFLAGS+= $(CURL_CFLAGS)
127 libtest_libtest_la_LIBADD+= $(PTHREAD_LIBS)
128 libtest_libtest_la_LIBADD+= $(CURL_LIBS)
130 libtest_libtest_la_DEPENDENCIES+= libtest_tmp_dir
131 libtest_libtest_la_DEPENDENCIES+=libtest/abort
132 libtest_libtest_la_DEPENDENCIES+=libtest/wait
134 # Declare unittest so that we can append to it
135 libtest_unittest_CXXFLAGS=
136 libtest_unittest_LDADD=
137 libtest_unittest_DEPENDENCIES=
139 # We are either building in tree, or with
140 if BUILDING_LIBMEMCACHED
141 libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcached.la
142 libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcachedutil.la
143 libtest_libtest_la_LIBADD+= libmemcached/libmemcached.la
144 libtest_libtest_la_LIBADD+= libmemcached/libmemcachedutil.la
145 libtest_libtest_la_SOURCES+= libtest/memcached.cc
146 libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBMEMCACHED
148 libtest_unittest_CXXFLAGS+= -DHAVE_LIBMEMCACHED
149 libtest_unittest_LDADD+= libmemcached/libmemcached.la
150 libtest_unittest_LDADD+= libmemcached/libmemcachedutil.la
151 libtest_unittest_DEPENDENCIES+= libmemcached/libmemcached.la
152 libtest_unittest_DEPENDENCIES+= libmemcached/libmemcachedutil.la
155 libtest_libtest_la_LIBADD+= $(libmemcached_LIBS)
156 libtest_libtest_la_SOURCES+= libtest/memcached.cc
158 libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
159 libtest_unittest_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
165 libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS)
166 libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS)
171 libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la
172 libtest_libtest_la_LIBADD+= libgearman/libgearman.la
173 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
174 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
175 libtest_libtest_la_SOURCES+= util/instance.cc
176 libtest_libtest_la_SOURCES+= util/operation.cc
178 libtest_unittest_LDADD+= libgearman/libgearman.la
179 libtest_unittest_DEPENDENCIES+= libgearman/libgearman.la
180 libtest_unittest_DEPENDENCIES+= gearmand/gearmand
183 libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la
184 libtest_libtest_la_LIBADD+= $(libgearman_LIBS)
185 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
186 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
187 libtest_libtest_la_SOURCES+= util/instance.cc
188 libtest_libtest_la_SOURCES+= util/operation.cc
192 libtest_tmp_dir: tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
195 @$(mkdir_p) tmp_chroot
197 tmp_chroot/var: tmp_chroot
198 @$(mkdir_p) tmp_chroot/var
200 tmp_chroot/var/log: tmp_chroot/var
201 @$(mkdir_p) tmp_chroot/var/log
203 tmp_chroot/var/tmp: tmp_chroot/var
204 @$(mkdir_p) tmp_chroot/var/tmp
206 tmp_chroot/var/drizzle: tmp_chroot/var
207 @$(mkdir_p) tmp_chroot/var/drizzle
209 tmp_chroot/var/run: tmp_chroot/var
210 @$(mkdir_p) tmp_chroot/var/run
213 libtest_unittest_DEPENDENCIES+= libtest/libtest.la
214 libtest_unittest_LDADD+= libtest/libtest.la
215 libtest_unittest_SOURCES= libtest/unittest.cc
216 check_PROGRAMS+= libtest/unittest
217 noinst_PROGRAMS+= libtest/unittest
218 test-unittest: libtest/unittest
221 valgrind-unittest: libtest/unittest
222 @$(VALGRIND_COMMAND) libtest/unittest TESTS_ENVIRONMENT="valgrind"
224 gdb-unittest: libtest/unittest
225 @$(GDB_COMMAND) libtest/unittest
227 helgrind-unittest: libtest/unittest
228 @$(HELGRIND_COMMAND) libtest/unittest
230 drd-unittest: libtest/unittest
231 @$(DRD_COMMAND) libtest/unittest
233 libtest_skiptest_LDADD= libtest/libtest.la
234 libtest_skiptest_SOURCES= libtest/skiptest.cc
235 check_PROGRAMS+= libtest/skiptest
236 noinst_PROGRAMS+= libtest/skiptest
238 libtest_wait_SOURCES=
239 libtest_wait_SOURCES+= libtest/wait.cc
240 libtest_wait_SOURCES+= libtest/dream.cc
241 noinst_PROGRAMS+= libtest/wait
243 libtest_abort_SOURCES= libtest/abort.cc
244 noinst_PROGRAMS+= libtest/abort