Lossen up restrictions on the recv().
[awesomized/libmemcached] / tests / include.am
1 # vim:ft=automake
2 # Copyright (C) 2011 Data Differential
3 # All rights reserved.
4 #
5 # Use and distribution licensed under the BSD license. See
6 # the COPYING file in the parent directory for full text.
7 #
8 # included from Top Level Makefile.am
9 # All paths should be given relative to the root
10
11 TESTS_LDADDS= \
12 libmemcached/libmemcached.la \
13 libtest/libserver.la \
14 libtest/libtest.la
15
16 VALGRIND_COMMAND= $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE
17
18 DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb
19
20 PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole
21
22 if BUILD_LIBMEMCACHEDUTIL
23 TESTS_LDADDS+= libmemcached/libmemcachedutil.la
24 endif
25
26 EXTRA_DIST+= \
27 tests/cpp_example.cc \
28 tests/output_plus.res
29
30 noinst_HEADERS+= \
31 tests/basic.h \
32 tests/error_conditions.h \
33 tests/hash_results.h \
34 tests/ketama_test_cases.h \
35 tests/ketama_test_cases_spy.h \
36 tests/libmemcached_world.h \
37 tests/parser.h \
38 tests/deprecated.h \
39 tests/pool.h \
40 tests/print.h \
41 tests/replication.h \
42 tests/string.h \
43 tests/virtual_buckets.h
44
45
46 noinst_PROGRAMS+= \
47 tests/atomsmasher \
48 tests/hash_plus \
49 tests/startservers \
50 tests/testapp \
51 tests/testhashkit \
52 tests/testplus \
53 tests/testudp
54
55 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
56 tests_testapp_SOURCES= \
57 tests/basic.cc \
58 tests/deprecated.cc \
59 tests/error_conditions.cc \
60 tests/mem_functions.cc \
61 tests/parser.cc \
62 tests/pool.cc \
63 tests/print.cc \
64 tests/replication.cc \
65 tests/string.cc \
66 tests/virtual_buckets.cc
67 tests_testapp_SOURCES+= clients/generator.cc clients/execute.cc
68
69 tests_testapp_DEPENDENCIES= \
70 $(BUILT_SOURCES) \
71 $(TESTS_LDADDS) \
72 libhashkit/libhashkit.la \
73 libmemcached/libmemcachedinternal.la
74
75 tests_testapp_LDADD= \
76 $(LIBSASL) \
77 $(TESTS_LDADDS) \
78 libhashkit/libhashkit.la \
79 libmemcached/libmemcachedinternal.la
80
81 tests_testplus_SOURCES= tests/plus.cpp
82 tests_testplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
83 tests_testplus_DEPENDENCIES= $(TESTS_LDADDS)
84 tests_testplus_LDADD= $(tests_testplus_DEPENDENCIES) $(LIBSASL)
85 check_PROGRAMS+= tests/testplus
86
87 tests_atomsmasher_SOURCES= tests/atomsmasher.c
88 tests_atomsmasher_SOURCES+= clients/generator.cc clients/execute.cc
89 tests_atomsmasher_DEPENDENCIES= $(TESTS_LDADDS)
90
91 tests_atomsmasher_LDADD= $(tests_atomsmasher_DEPENDENCIES) $(LIBSASL)
92
93 tests_testudp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
94 tests_testudp_SOURCES= tests/mem_udp.c
95 tests_testudp_DEPENDENCIES= $(TESTS_LDADDS)
96
97 tests_testudp_LDADD= $(tests_testudp_DEPENDENCIES) $(LIBSASL)
98
99 tests_startservers_SOURCES= tests/start.c
100 tests_startservers_DEPENDENCIES= $(TESTS_LDADDS)
101 tests_startservers_LDADD= $(tests_startservers_DEPENDENCIES) $(LIBSASL)
102
103 tests_testhashkit_SOURCES = tests/hashkit_functions.c
104 tests_testhashkit_DEPENDENCIES = libtest/libtest.la libhashkit/libhashkit.la
105 tests_testhashkit_LDADD = $(tests_testhashkit_DEPENDENCIES)
106
107 tests_hash_plus_SOURCES= tests/hash_plus.cc
108 tests_hash_plus_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
109 tests_hash_plus_DEPENDENCIES= $(tests_testhashkit_DEPENDENCIES)
110 tests_hash_plus_LDADD= $(tests_testhashkit_DEPENDENCIES)
111 check_PROGRAMS+= tests/hash_plus
112
113 test: check
114
115 check-local: tests/var $(TEST_DOCS) test-mem test-hash memcapable
116 @echo "Tests completed"
117
118 test-x: check-local test-plus test-memcat test-memcp test-memrm test-memerror test-memdump test-memflush test-memstat
119 @echo "Tests completed"
120
121 memcapable: clients/memcapable
122 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
123 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
124 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
125 @rm tests/Xumemc.pid
126
127 test-memcat: clients/memcat clients/memcp
128 @echo "Testing memcat"
129 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
130 @clients/memcp --servers="localhost:12555" `pwd`/clients/memcp
131 @clients/memcat --servers="localhost:12555" memcp > `pwd`/tests/scratch
132 @clients/memcat --servers="localhost:12555" --file=`pwd`/tests/scratch2 memcp
133 # @diff clients/memcp tests/scratch
134 @cat `pwd`/tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
135 @rm `pwd`/tests/Xumemc.pid
136 @rm `pwd`/tests/scratch
137 @rm `pwd`/tests/scratch2
138
139 valgrind-memcat: clients/memcat clients/memcp
140 @echo "Testing memcat"
141 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
142 @clients/memcp --servers="localhost:12555" clients/memcp
143 @$(VALGRIND_COMMAND) clients/memcat --servers="localhost:12555" memcp > tests/scratch
144 # @diff clients/memcp tests/scratch
145 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
146 @rm tests/Xumemc.pid
147 @rm tests/scratch
148
149 test-memcp: clients/memcp
150 @echo "Testing memcp"
151 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
152 @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
153 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
154 @rm tests/Xumemc.pid
155
156 valgrind-memcp: clients/memcat clients/memcp
157 @echo "Testing memcp"
158 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
159 @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
160 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
161 @rm tests/Xumemc.pid
162
163 test-memrm: clients/memrm clients/memcp
164 @echo "Testing memrm"
165 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
166 @clients/memcp --servers="localhost:12555" clients/memcat
167 @clients/memrm --servers="localhost:12555" memcat
168 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
169 @rm tests/Xumemc.pid
170
171 valgrind-memrm: clients/memcat clients/memcp
172 @echo "Testing memrm"
173 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
174 @clients/memcp --servers="localhost:12555" clients/memcat
175 @$(VALGRIND_COMMAND) clients/memrm --servers="localhost:12555" memcat
176 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
177 @rm tests/Xumemc.pid
178
179 test-memflush: clients/memflush
180 @echo "Testing memflush"
181 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
182 @clients/memflush --servers="localhost:12555"
183 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
184 @rm tests/Xumemc.pid
185
186 valgrind-memflush: clients/memflush
187 @echo "Testing memflush"
188 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
189 @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
190 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
191 @rm tests/Xumemc.pid
192
193 test-memdump: clients/memdump clients/memcp
194 @echo "Testing memdump"
195 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
196 @clients/memcp --servers="localhost:12555" clients/memcat
197 @clients/memdump --servers="localhost:12555" > /dev/null
198 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
199 @rm tests/Xumemc.pid
200
201 valgrind-memdump: clients/memcat clients/memcp
202 @echo "Testing memdump"
203 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
204 @clients/memcp --servers="localhost:12555" clients/memcat
205 @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
206 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
207 @rm tests/Xumemc.pid
208
209 test-memstat: clients/memstat
210 @echo "Testing memstat"
211 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
212 @clients/memstat --servers="localhost:12555" > /dev/null
213 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
214 @rm tests/Xumemc.pid
215
216 valgrind-memstat: clients/memstat
217 @echo "Testing memstat"
218 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
219 @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
220 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
221 @rm tests/Xumemc.pid
222
223 test-memerror: clients/memerror
224 @echo "Testing memerror"
225 @clients/memerror 0 > /dev/null
226
227 valgrind-memerror: clients/memerror
228 @echo "Testing memerror"
229 @$(VALGRIND_COMMAND) clients/memerror 0 > /dev/null
230
231
232
233
234
235 MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE)
236
237 MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
238
239 TESTPLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
240
241 HASHPLUS_COMMAND= tests/hashplus $(COLLECTION) $(SUITE)
242
243 ATOM_COMMAND= tests/atomsmasher $(COLLECTION) $(SUITE)
244
245 UDP_COMMAND= tests/testudp $(COLLECTION) $(SUITE)
246
247 HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
248
249 test-mem: tests/testapp
250 $(MEM_COMMAND)
251
252 test-udp: tests/testudp
253 $(UDP_COMMAND)
254
255 test-atom: tests/atomsmasher
256 $(ATOM_COMMAND)
257
258 test-plus: tests/testplus
259 $(TESTPLUS_COMMAND)
260
261 test-hash: tests/testhashkit
262 $(HASH_COMMAND)
263
264 test-hashplus: tests/hashplus
265 $(HASHPLUS_COMMAND)
266
267 pahole-mem: tests/testapp
268 $(PAHOLE_COMMAND) $(MEM_COMMAND)
269
270 gdb-mem: tests/testapp
271 $(DEBUG_COMMAND) $(MEM_COMMAND)
272
273 gdb-atom: tests/atomsmasher
274 $(DEBUG_COMMAND) $(UDP_COMMAND)
275
276 gdb-udp: tests/testudp
277 $(DEBUG_COMMAND) $(ATOM_COMMAND)
278
279 gdb-plus: tests/testplus
280 $(DEBUG_COMMAND) $(TESTPLUS_COMMAND)
281
282 gdb-hash: tests/testhashkit
283 $(DEBUG_COMMAND) $(HASH_COMMAND)
284
285 gdb-hashplus: tests/hashplus
286 $(DEBUG_COMMAND) $(HASHPLUS_COMMAND)
287
288 gdb-memslap: clients/memslap
289 $(DEBUG_COMMAND) $(MEMSLAP_COMMAND)
290
291 valgrind-mem: tests/testapp
292 $(VALGRIND_COMMAND) $(MEM_COMMAND)
293
294 valgrind-atom: tests/atomsmasher
295 $(VALGRIND_COMMAND) $(ATOM_COMMAND)
296
297 valgrind-udp: tests/testudp
298 $(VALGRIND_COMMAND) $(UDP_COMMAND)
299
300 valgrind-plus: tests/testplus
301 $(VALGRIND_COMMAND) $(TESTPLUS_COMMAND)
302
303 valgrind-hash: tests/testhashkit
304 $(VALGRIND_COMMAND) $(HASH_COMMAND)
305
306 valgrind-hashplus: tests/hashplus
307 $(VALGRIND_COMMAND) $(HASHPLUS_COMMAND)
308
309 valgrind-memslap: clients/memslap
310 $(VALGRIND_COMMAND) $(MEMSLAP_COMMAND)
311
312 PHONY += valgrind
313 valgrind: tests/testapp tests/testhashkit valgrind-mem valgrind-hash valgrind-memcat valgrind-memcp valgrind-memrm valgrind-memerror valgrind-memdump valgrind-memflush valgrind-memstat
314
315 PHONY += cachegrind
316 CLEANFILES += tests/cachegrind.out
317 cachegrind:
318 rm -f tests/cachegrind.out.*
319 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
320 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
321
322 PHONY += callgrind
323 CLEANFILES += tests/callgrind.out
324 callgrind:
325 rm -f tests/callgrind.out.*
326 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
327 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
328
329 PHONY += helgrind
330 CLEANFILES+= helgrind.out.*
331 helgrind:
332 rm -f helgrind.out.*
333 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
334
335 PHONY += helgrind-slap
336 helgrind-slap:
337 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
338
339 test-no-outputdiff: test
340
341 hudson-valgrind: tests/testapp
342 $(VALGRIND_COMMAND) --log-file=tests/valgrind.out $(MEM_COMMAND)