jenkins-promote-staging-trunk-libmemcached-16
[awesomized/libmemcached] / libtest / include.am
1 # vim:ft=automake
2 #
3 # included from Top Level Makefile.am
4 # All paths should be given relative to the root
5 #
6
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
14
15 export LIBTOOL_COMMAND
16 export VALGRIND_COMMAND
17 export HELGRIND_COMMAND
18 export DRD_COMMAND
19 export GDB_COMMAND
20
21 valgrind:
22 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_EXEC_COMMAND)\""
23
24 gdb:
25 @echo make check TESTS_ENVIRONMENT="\"$(GDB_COMMAND)\""
26
27 helgrind:
28 @echo make check TESTS_ENVIRONMENT="\"$(HELGRIND_COMMAND)\""
29
30 drd:
31 @echo make check TESTS_ENVIRONMENT="\"$(DRD_COMMAND)\""
32
33 EXTRA_DIST+= libtest/run.gdb
34
35 CLEANFILES+= \
36 tmp_chroot/var/drizzle/* \
37 tmp_chroot/var/log/* \
38 tmp_chroot/var/run/* \
39 tmp_chroot/var/tmp/*
40
41 .PHONY: distclean-libtest-check
42 distclean-libtest-check:
43 -rm -rf tmp_chroot
44
45 noinst_HEADERS+= libtest/timer.hpp
46 noinst_HEADERS+= \
47 libtest/binaries.h \
48 libtest/cpu.hpp \
49 libtest/blobslap_worker.h \
50 libtest/callbacks.h \
51 libtest/cmdline.h \
52 libtest/collection.h \
53 libtest/common.h \
54 libtest/comparison.hpp \
55 libtest/core.h \
56 libtest/dream.h \
57 libtest/error.h \
58 libtest/failed.h \
59 libtest/fatal.hpp \
60 libtest/framework.h \
61 libtest/gearmand.h \
62 libtest/drizzled.h \
63 libtest/get.h \
64 libtest/has.hpp \
65 libtest/http.hpp \
66 libtest/is_pid.hpp \
67 libtest/is_local.hpp \
68 libtest/killpid.h \
69 libtest/libtool.hpp \
70 libtest/memcached.h \
71 libtest/port.h \
72 libtest/runner.h \
73 libtest/server.h \
74 libtest/server_container.h \
75 libtest/signal.h \
76 libtest/socket.hpp \
77 libtest/stream.h \
78 libtest/strerror.h \
79 libtest/string.hpp \
80 libtest/test.h \
81 libtest/test.hpp \
82 libtest/tmpfile.hpp \
83 libtest/vchar.hpp \
84 libtest/visibility.h \
85 libtest/wait.h
86
87 noinst_LTLIBRARIES+= libtest/libtest.la
88
89 libtest_libtest_la_CXXFLAGS=
90 libtest_libtest_la_DEPENDENCIES=
91 libtest_libtest_la_LIBADD=
92 libtest_libtest_la_SOURCES=
93
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
121
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)
126
127 libtest_libtest_la_LIBADD+= $(PTHREAD_LIBS)
128 libtest_libtest_la_LIBADD+= $(CURL_LIBS)
129
130 libtest_libtest_la_DEPENDENCIES+= libtest_tmp_dir
131 libtest_libtest_la_DEPENDENCIES+=libtest/abort
132 libtest_libtest_la_DEPENDENCIES+=libtest/wait
133
134 # Declare unittest so that we can append to it
135 libtest_unittest_CXXFLAGS=
136 libtest_unittest_LDADD=
137 libtest_unittest_DEPENDENCIES=
138
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
147
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
153 else
154 if HAVE_LIBMEMCACHED
155 libtest_libtest_la_LIBADD+= $(libmemcached_LIBS)
156 libtest_libtest_la_SOURCES+= libtest/memcached.cc
157 else
158 libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
159 libtest_unittest_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
160 endif
161 endif
162
163 if HAVE_LIBDRIZZLE
164
165 libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS)
166 libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS)
167
168 endif
169
170 if BUILDING_GEARMAN
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
177
178 libtest_unittest_LDADD+= libgearman/libgearman.la
179 libtest_unittest_DEPENDENCIES+= libgearman/libgearman.la
180 libtest_unittest_DEPENDENCIES+= gearmand/gearmand
181 else
182 if HAVE_LIBGEARMAN
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
189 endif
190 endif
191
192 libtest_tmp_dir: tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
193
194 tmp_chroot:
195 @$(mkdir_p) tmp_chroot
196
197 tmp_chroot/var: tmp_chroot
198 @$(mkdir_p) tmp_chroot/var
199
200 tmp_chroot/var/log: tmp_chroot/var
201 @$(mkdir_p) tmp_chroot/var/log
202
203 tmp_chroot/var/tmp: tmp_chroot/var
204 @$(mkdir_p) tmp_chroot/var/tmp
205
206 tmp_chroot/var/drizzle: tmp_chroot/var
207 @$(mkdir_p) tmp_chroot/var/drizzle
208
209 tmp_chroot/var/run: tmp_chroot/var
210 @$(mkdir_p) tmp_chroot/var/run
211
212
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
219 @libtest/unittest
220
221 valgrind-unittest: libtest/unittest
222 @$(VALGRIND_COMMAND) libtest/unittest TESTS_ENVIRONMENT="valgrind"
223
224 gdb-unittest: libtest/unittest
225 @$(GDB_COMMAND) libtest/unittest
226
227 helgrind-unittest: libtest/unittest
228 @$(HELGRIND_COMMAND) libtest/unittest
229
230 drd-unittest: libtest/unittest
231 @$(DRD_COMMAND) libtest/unittest
232
233 libtest_skiptest_LDADD= libtest/libtest.la
234 libtest_skiptest_SOURCES= libtest/skiptest.cc
235 check_PROGRAMS+= libtest/skiptest
236 noinst_PROGRAMS+= libtest/skiptest
237
238 libtest_wait_SOURCES=
239 libtest_wait_SOURCES+= libtest/wait.cc
240 libtest_wait_SOURCES+= libtest/dream.cc
241 noinst_PROGRAMS+= libtest/wait
242
243 libtest_abort_SOURCES= libtest/abort.cc
244 noinst_PROGRAMS+= libtest/abort