jenkins-promote-staging-trunk-libmemcached-11
[awesomized/libmemcached] / libtest / include.am
1 # vim:ft=automake
2 # Copyright (C) 2011 Data Differential, http://datadifferential.com/
3 # All rights reserved.
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 3 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #
19 # included from Top Level Makefile.am
20 # All paths should be given relative to the root
21 #
22
23 LIBTOOL_COMMAND= ${abs_top_builddir}/libtool --mode=execute
24 VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE
25 VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)
26 HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes
27 DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd
28 GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
29 PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=1
30
31 export LIBTOOL_COMMAND
32 export VALGRIND_COMMAND
33 export HELGRIND_COMMAND
34 export DRD_COMMAND
35 export GDB_COMMAND
36
37 valgrind:
38 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_EXEC_COMMAND)\""
39
40 gdb:
41 @echo make check TESTS_ENVIRONMENT="\"$(GDB_COMMAND)\""
42
43 helgrind:
44 @echo make check TESTS_ENVIRONMENT="\"$(HELGRIND_COMMAND)\""
45
46 drd:
47 @echo make check TESTS_ENVIRONMENT="\"$(DRD_COMMAND)\""
48
49 EXTRA_DIST+= libtest/run.gdb
50
51 CLEANFILES+= \
52 tmp_chroot/var/drizzle/* \
53 tmp_chroot/var/log/* \
54 tmp_chroot/var/run/* \
55 tmp_chroot/var/tmp/*
56
57 .PHONY: distclean-libtest-check
58 distclean-libtest-check:
59 -rm -rf tmp_chroot
60
61 noinst_HEADERS+= \
62 libtest/binaries.h \
63 libtest/cpu.hpp \
64 libtest/blobslap_worker.h \
65 libtest/callbacks.h \
66 libtest/cmdline.h \
67 libtest/collection.h \
68 libtest/common.h \
69 libtest/comparison.hpp \
70 libtest/core.h \
71 libtest/dream.h \
72 libtest/error.h \
73 libtest/failed.h \
74 libtest/fatal.hpp \
75 libtest/framework.h \
76 libtest/gearmand.h \
77 libtest/drizzled.h \
78 libtest/get.h \
79 libtest/has.hpp \
80 libtest/http.hpp \
81 libtest/is_pid.hpp \
82 libtest/is_local.hpp \
83 libtest/killpid.h \
84 libtest/libtool.hpp \
85 libtest/memcached.h \
86 libtest/port.h \
87 libtest/runner.h \
88 libtest/server.h \
89 libtest/server_container.h \
90 libtest/signal.h \
91 libtest/socket.hpp \
92 libtest/stats.h \
93 libtest/stream.h \
94 libtest/strerror.h \
95 libtest/string.hpp \
96 libtest/test.h \
97 libtest/test.hpp \
98 libtest/tmpfile.hpp \
99 libtest/vchar.hpp \
100 libtest/visibility.h \
101 libtest/wait.h
102
103 noinst_LTLIBRARIES+= libtest/libtest.la
104
105 libtest_libtest_la_CXXFLAGS=
106 libtest_libtest_la_DEPENDENCIES=
107 libtest_libtest_la_LIBADD=
108 libtest_libtest_la_SOURCES=
109
110 libtest_libtest_la_SOURCES+= libtest/binaries.cc
111 libtest_libtest_la_SOURCES+= libtest/cmdline.cc
112 libtest_libtest_la_SOURCES+= libtest/comparison.cc
113 libtest_libtest_la_SOURCES+= libtest/core.cc
114 libtest_libtest_la_SOURCES+= libtest/cpu.cc
115 libtest_libtest_la_SOURCES+= libtest/dream.cc
116 libtest_libtest_la_SOURCES+= libtest/fatal.cc
117 libtest_libtest_la_SOURCES+= libtest/framework.cc
118 libtest_libtest_la_SOURCES+= libtest/has.cc
119 libtest_libtest_la_SOURCES+= libtest/drizzled.cc
120 libtest_libtest_la_SOURCES+= libtest/http.cc
121 libtest_libtest_la_SOURCES+= libtest/is_local.cc
122 libtest_libtest_la_SOURCES+= libtest/killpid.cc
123 libtest_libtest_la_SOURCES+= libtest/libtool.cc
124 libtest_libtest_la_SOURCES+= libtest/main.cc
125 libtest_libtest_la_SOURCES+= libtest/port.cc
126 libtest_libtest_la_SOURCES+= libtest/runner.cc
127 libtest_libtest_la_SOURCES+= libtest/server.cc
128 libtest_libtest_la_SOURCES+= libtest/server_container.cc
129 libtest_libtest_la_SOURCES+= libtest/signal.cc
130 libtest_libtest_la_SOURCES+= libtest/socket.cc
131 libtest_libtest_la_SOURCES+= libtest/strerror.cc
132 libtest_libtest_la_SOURCES+= libtest/tmpfile.cc
133 libtest_libtest_la_SOURCES+= libtest/vchar.cc
134
135 libtest_libtest_la_CXXFLAGS+= -DBUILDING_LIBTEST
136 libtest_libtest_la_CXXFLAGS+= $(PTHREAD_CFLAGS)
137 libtest_libtest_la_CXXFLAGS+= -DLIBTEST_TEMP="\"tmp_chroot\""
138 libtest_libtest_la_CXXFLAGS+= $(CURL_CFLAGS)
139
140 libtest_libtest_la_LIBADD+= $(PTHREAD_LIBS)
141 libtest_libtest_la_LIBADD+= $(CURL_LIBS)
142
143 libtest_libtest_la_DEPENDENCIES+= libtest_tmp_dir
144 libtest_libtest_la_DEPENDENCIES+=libtest/abort
145 libtest_libtest_la_DEPENDENCIES+=libtest/wait
146
147 # Declare unittest so that we can append to it
148 libtest_unittest_CXXFLAGS=
149 libtest_unittest_LDADD=
150 libtest_unittest_DEPENDENCIES=
151
152 # We are either building in tree, or with
153 if BUILDING_LIBMEMCACHED
154 libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcached.la
155 libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcachedutil.la
156 libtest_libtest_la_LIBADD+= libmemcached/libmemcached.la
157 libtest_libtest_la_LIBADD+= libmemcached/libmemcachedutil.la
158 libtest_libtest_la_SOURCES+= libtest/memcached.cc
159 libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBMEMCACHED
160
161 libtest_unittest_CXXFLAGS+= -DHAVE_LIBMEMCACHED
162 libtest_unittest_LDADD+= libmemcached/libmemcached.la
163 libtest_unittest_LDADD+= libmemcached/libmemcachedutil.la
164 libtest_unittest_DEPENDENCIES+= libmemcached/libmemcached.la
165 libtest_unittest_DEPENDENCIES+= libmemcached/libmemcachedutil.la
166 else
167 if HAVE_LIBMEMCACHED
168 libtest_libtest_la_LIBADD+= $(libmemcached_LIBS)
169 libtest_libtest_la_SOURCES+= libtest/memcached.cc
170 else
171 libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
172 libtest_unittest_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
173 endif
174 endif
175
176 if HAVE_LIBDRIZZLE
177
178 libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS)
179 libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS)
180
181 endif
182
183 if BUILDING_GEARMAN
184 libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la
185 libtest_libtest_la_LIBADD+= libgearman/libgearman.la
186 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
187 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
188 libtest_libtest_la_SOURCES+= util/instance.cc
189 libtest_libtest_la_SOURCES+= util/operation.cc
190
191 libtest_unittest_LDADD+= libgearman/libgearman.la
192 libtest_unittest_DEPENDENCIES+= libgearman/libgearman.la
193 libtest_unittest_DEPENDENCIES+= gearmand/gearmand
194 else
195 if HAVE_LIBGEARMAN
196 libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la
197 libtest_libtest_la_LIBADD+= $(libgearman_LIBS)
198 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
199 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
200 libtest_libtest_la_SOURCES+= util/instance.cc
201 libtest_libtest_la_SOURCES+= util/operation.cc
202 endif
203 endif
204
205 libtest_tmp_dir: tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
206
207 tmp_chroot:
208 @$(mkdir_p) tmp_chroot
209
210 tmp_chroot/var: tmp_chroot
211 @$(mkdir_p) tmp_chroot/var
212
213 tmp_chroot/var/log: tmp_chroot/var
214 @$(mkdir_p) tmp_chroot/var/log
215
216 tmp_chroot/var/tmp: tmp_chroot/var
217 @$(mkdir_p) tmp_chroot/var/tmp
218
219 tmp_chroot/var/drizzle: tmp_chroot/var
220 @$(mkdir_p) tmp_chroot/var/drizzle
221
222 tmp_chroot/var/run: tmp_chroot/var
223 @$(mkdir_p) tmp_chroot/var/run
224
225
226 libtest_unittest_DEPENDENCIES+= libtest/libtest.la
227 libtest_unittest_LDADD+= libtest/libtest.la
228 libtest_unittest_SOURCES= libtest/unittest.cc
229 check_PROGRAMS+= libtest/unittest
230 noinst_PROGRAMS+= libtest/unittest
231 test-unittest: libtest/unittest
232 @libtest/unittest
233
234 valgrind-unittest: libtest/unittest
235 @$(VALGRIND_COMMAND) libtest/unittest TESTS_ENVIRONMENT="valgrind"
236
237 gdb-unittest: libtest/unittest
238 @$(GDB_COMMAND) libtest/unittest
239
240 helgrind-unittest: libtest/unittest
241 @$(HELGRIND_COMMAND) libtest/unittest
242
243 drd-unittest: libtest/unittest
244 @$(DRD_COMMAND) libtest/unittest
245
246 libtest_skiptest_LDADD= libtest/libtest.la
247 libtest_skiptest_SOURCES= libtest/skiptest.cc
248 check_PROGRAMS+= libtest/skiptest
249 noinst_PROGRAMS+= libtest/skiptest
250
251 libtest_wait_SOURCES=
252 libtest_wait_SOURCES+= libtest/wait.cc
253 libtest_wait_SOURCES+= libtest/dream.cc
254 noinst_PROGRAMS+= libtest/wait
255
256 libtest_abort_SOURCES= libtest/abort.cc
257 noinst_PROGRAMS+= libtest/abort