Merge in change such that we now use "config_" as the prepend on the
[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
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/print.h \
39 tests/replication.h \
40 tests/string.h
41
42
43 noinst_PROGRAMS+= \
44 tests/atomsmasher \
45 tests/hashplus \
46 tests/memplus \
47 tests/startservers \
48 tests/testapp \
49 tests/testhashkit \
50 tests/testplus \
51 tests/testudp
52
53 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
54 tests_testapp_SOURCES= \
55 tests/basic.cc \
56 tests/error_conditions.cc \
57 tests/mem_functions.c \
58 tests/parser.cc \
59 tests/print.cc \
60 tests/replication.cc \
61 tests/string.cc
62
63 tests_testapp_DEPENDENCIES= \
64 $(BUILT_SOURCES) \
65 clients/libgenexec.la \
66 libmemcached/libmemcachedinternal.la \
67 $(TESTS_LDADDS)
68
69 tests_testapp_LDADD= clients/libgenexec.la \
70 libmemcached/libmemcachedinternal.la \
71 $(TESTS_LDADDS) $(LIBSASL)
72
73 tests_testplus_SOURCES= tests/plus.cpp
74 tests_testplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
75 tests_testplus_DEPENDENCIES= $(TESTS_LDADDS)
76 tests_testplus_LDADD= $(tests_testplus_DEPENDENCIES) $(LIBSASL)
77
78 tests_atomsmasher_SOURCES= tests/atomsmasher.c
79 tests_atomsmasher_DEPENDENCIES= \
80 clients/libgenexec.la \
81 $(TESTS_LDADDS)
82
83 tests_atomsmasher_LDADD= $(tests_atomsmasher_DEPENDENCIES) $(LIBSASL)
84
85 tests_testudp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
86 tests_testudp_SOURCES= tests/mem_udp.c
87 tests_testudp_DEPENDENCIES= \
88 clients/libgenexec.la \
89 $(TESTS_LDADDS)
90
91 tests_testudp_LDADD= $(tests_testudp_DEPENDENCIES) $(LIBSASL)
92
93 tests_startservers_SOURCES= tests/start.c
94 tests_startservers_DEPENDENCIES= $(TESTS_LDADDS)
95 tests_startservers_LDADD= $(tests_startservers_DEPENDENCIES) $(LIBSASL)
96
97 tests_testhashkit_SOURCES = tests/hashkit_functions.c
98 tests_testhashkit_DEPENDENCIES = libtest/libtest.la libhashkit/libhashkit.la
99 tests_testhashkit_LDADD = $(tests_testhashkit_DEPENDENCIES) $(LIBSASL)
100
101 tests_hashplus_SOURCES = tests/hash_plus.cc
102 tests_hashplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
103 tests_hashplus_DEPENDENCIES = $(tests_testhashkit_DEPENDENCIES)
104 tests_hashplus_LDADD = $(tests_testhashkit_DEPENDENCIES) $(LIBSASL)
105
106 tests_memplus_SOURCES = tests/mem_plus.cc
107 tests_memplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
108 tests_memplus_DEPENDENCIES = $(TESTS_LDADDS)
109 tests_memplus_LDADD = $(tests_memplus_DEPENDENCIES) $(LIBSASL)
110
111 test: check
112
113 check-local: $(TEST_DOCS) test-mem test-hash memcapable
114 @echo "Tests completed"
115
116 test-x: check-local test-plus test-memcat test-memcp test-memrm test-memerror test-memdump test-memflush test-memstat
117 @echo "Tests completed"
118
119 memcapable: clients/memcapable
120 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
121 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
122 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
123 @rm tests/Xumemc.pid
124
125 test-memcat: clients/memcat clients/memcp
126 @echo "Testing memcat"
127 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
128 @clients/memcp --servers="localhost:12555" `pwd`/clients/memcp
129 @clients/memcat --servers="localhost:12555" memcp > `pwd`/tests/scratch
130 @clients/memcat --servers="localhost:12555" --file=`pwd`/tests/scratch2 memcp
131 # @diff clients/memcp tests/scratch
132 @cat `pwd`/tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
133 @rm `pwd`/tests/Xumemc.pid
134 @rm `pwd`/tests/scratch
135 @rm `pwd`/tests/scratch2
136
137 valgrind-memcat: clients/memcat clients/memcp
138 @echo "Testing memcat"
139 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
140 @clients/memcp --servers="localhost:12555" clients/memcp
141 @$(VALGRIND_COMMAND) clients/memcat --servers="localhost:12555" memcp > tests/scratch
142 # @diff clients/memcp tests/scratch
143 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
144 @rm tests/Xumemc.pid
145 @rm tests/scratch
146
147 test-memcp: clients/memcp
148 @echo "Testing memcp"
149 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
150 @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
151 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
152 @rm tests/Xumemc.pid
153
154 valgrind-memcp: clients/memcat clients/memcp
155 @echo "Testing memcp"
156 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
157 @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
158 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
159 @rm tests/Xumemc.pid
160
161 test-memrm: clients/memrm clients/memcp
162 @echo "Testing memrm"
163 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
164 @clients/memcp --servers="localhost:12555" clients/memcat
165 @clients/memrm --servers="localhost:12555" memcat
166 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
167 @rm tests/Xumemc.pid
168
169 valgrind-memrm: clients/memcat clients/memcp
170 @echo "Testing memrm"
171 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
172 @clients/memcp --servers="localhost:12555" clients/memcat
173 @$(VALGRIND_COMMAND) clients/memrm --servers="localhost:12555" memcat
174 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
175 @rm tests/Xumemc.pid
176
177 test-memflush: clients/memflush
178 @echo "Testing memflush"
179 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
180 @clients/memflush --servers="localhost:12555"
181 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
182 @rm tests/Xumemc.pid
183
184 valgrind-memflush: clients/memflush
185 @echo "Testing memflush"
186 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
187 @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
188 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
189 @rm tests/Xumemc.pid
190
191 test-memdump: clients/memdump clients/memcp
192 @echo "Testing memdump"
193 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
194 @clients/memcp --servers="localhost:12555" clients/memcat
195 @clients/memdump --servers="localhost:12555" > /dev/null
196 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
197 @rm tests/Xumemc.pid
198
199 valgrind-memdump: clients/memcat clients/memcp
200 @echo "Testing memdump"
201 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
202 @clients/memcp --servers="localhost:12555" clients/memcat
203 @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
204 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
205 @rm tests/Xumemc.pid
206
207 test-memstat: clients/memstat
208 @echo "Testing memstat"
209 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
210 @clients/memstat --servers="localhost:12555" > /dev/null
211 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
212 @rm tests/Xumemc.pid
213
214 valgrind-memstat: clients/memstat
215 @echo "Testing memstat"
216 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
217 @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
218 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
219 @rm tests/Xumemc.pid
220
221 test-memerror: clients/memerror
222 @echo "Testing memerror"
223 @clients/memerror 0 > /dev/null
224
225 valgrind-memerror: clients/memerror
226 @echo "Testing memerror"
227 @$(VALGRIND_COMMAND) clients/memerror 0 > /dev/null
228
229
230
231
232
233 MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE)
234
235 MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
236
237 TESTPLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
238
239 MEMPLUS_COMMAND= tests/memplus $(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 support/example.cnf
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 test-memplus: tests/memplus
268 $(MEMPLUS_COMMAND)
269
270 pahole-mem: tests/testapp
271 $(PAHOLE_COMMAND) $(MEM_COMMAND)
272
273 gdb-mem: tests/testapp
274 $(DEBUG_COMMAND) $(MEM_COMMAND)
275
276 gdb-atom: tests/atomsmasher
277 $(DEBUG_COMMAND) $(UDP_COMMAND)
278
279 gdb-udp: tests/testudp
280 $(DEBUG_COMMAND) $(ATOM_COMMAND)
281
282 gdb-plus: tests/testplus
283 $(DEBUG_COMMAND) $(TESTPLUS_COMMAND)
284
285 gdb-hash: tests/testhashkit
286 $(DEBUG_COMMAND) $(HASH_COMMAND)
287
288 gdb-hashplus: tests/hashplus
289 $(DEBUG_COMMAND) $(HASHPLUS_COMMAND)
290
291 gdb-memplus: tests/memplus
292 $(DEBUG_COMMAND) $(MEMPLUS_COMMAND)
293
294 gdb-memslap: clients/memslap
295 $(DEBUG_COMMAND) $(MEMSLAP_COMMAND)
296
297 valgrind-mem: tests/testapp
298 $(VALGRIND_COMMAND) $(MEM_COMMAND)
299
300 valgrind-atom: tests/atomsmasher
301 $(VALGRIND_COMMAND) $(ATOM_COMMAND)
302
303 valgrind-udp: tests/testudp
304 $(VALGRIND_COMMAND) $(UDP_COMMAND)
305
306 valgrind-plus: tests/testplus
307 $(VALGRIND_COMMAND) $(TESTPLUS_COMMAND)
308
309 valgrind-hash: tests/testhashkit
310 $(VALGRIND_COMMAND) $(HASH_COMMAND)
311
312 valgrind-hashplus: tests/hashplus
313 $(VALGRIND_COMMAND) $(HASHPLUS_COMMAND)
314
315 valgrind-memplus: tests/memplus
316 $(VALGRIND_COMMAND) $(MEMPLUS_COMMAND)
317
318 valgrind-memslap: clients/memslap
319 $(VALGRIND_COMMAND) $(MEMSLAP_COMMAND)
320
321 PHONY += valgrind
322 valgrind: tests/testapp tests/testhashkit valgrind-mem valgrind-hash valgrind-memcat valgrind-memcp valgrind-memrm valgrind-memerror valgrind-memdump valgrind-memflush valgrind-memstat
323
324 PHONY += cachegrind
325 CLEANFILES += tests/cachegrind.out
326 cachegrind:
327 rm -f tests/cachegrind.out.*
328 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
329 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
330
331 PHONY += callgrind
332 CLEANFILES += tests/callgrind.out
333 callgrind:
334 rm -f tests/callgrind.out.*
335 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
336 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
337
338 PHONY += helgrind
339 CLEANFILES+= helgrind.out.*
340 helgrind:
341 rm -f helgrind.out.*
342 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
343
344 PHONY += helgrind-slap
345 helgrind-slap:
346 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
347
348 test-no-outputdiff: test
349
350 hudson-valgrind: tests/testapp
351 $(VALGRIND_COMMAND) --log-file=tests/valgrind.out $(MEM_COMMAND)