Merge trunk
[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 libmemcached/libmemcachedutil.la \
14 libtest/libtest.la
15
16 DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb
17
18 PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole
19
20 EXTRA_DIST+= \
21 tests/cpp_example.cc \
22 tests/output_plus.res
23
24 noinst_HEADERS+= \
25 tests/basic.h \
26 tests/callbacks.h \
27 tests/debug.h \
28 tests/error_conditions.h \
29 tests/exist.h \
30 tests/hash_results.h \
31 tests/ketama.h \
32 tests/ketama_test_cases.h \
33 tests/ketama_test_cases_spy.h \
34 tests/libmemcached_world.h \
35 tests/namespace.h \
36 tests/parser.h \
37 tests/touch.h \
38 tests/deprecated.h \
39 tests/pool.h \
40 tests/print.h \
41 tests/replication.h \
42 tests/server_add.h \
43 tests/string.h \
44 tests/virtual_buckets.h
45
46 # Cycle should always run first
47 tests_cycle_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
48 tests_cycle_CXXFLAGS= $(AM_CXXFLAGS)
49 tests_cycle_CXXFLAGS+= ${PTHREAD_CFLAGS}
50 tests_cycle_SOURCES= tests/cycle.cc
51 tests_cycle_DEPENDENCIES= $(TESTS_LDADDS)
52 tests_cycle_LDADD= $(tests_cycle_DEPENDENCIES)
53 tests_cycle_LDADD+= ${PTHREAD_LIBS}
54 check_PROGRAMS+= tests/cycle
55 noinst_PROGRAMS+= tests/cycle
56
57 # Test internals
58 tests_internals_SOURCES= tests/internals.cc
59 tests_internals_SOURCES+= tests/string.cc
60 tests_internals_CXXFLAGS = $(AM_CXXFLAGS) ${PTHREAD_CFLAGS}
61 tests_internals_DEPENDENCIES= libmemcachedinternal/libmemcachedinternal.la libtest/libtest.la libmemcachedinternal/libmemcachedutilinternal.la
62 tests_internals_LDADD= libmemcachedinternal/libmemcachedinternal.la
63 tests_internals_LDADD+= ${PTHREAD_LIBS}
64 tests_internals_LDADD+= libmemcachedinternal/libmemcachedutilinternal.la
65 tests_internals_LDADD+= libtest/libtest.la
66 check_PROGRAMS+= tests/internals
67 noinst_PROGRAMS+= tests/internals
68
69
70 tests_testapp_CXXFLAGS = $(AM_CXXFLAGS) ${PTHREAD_CFLAGS}
71 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
72 tests_testapp_SOURCES= \
73 tests/basic.cc \
74 tests/debug.cc \
75 tests/deprecated.cc \
76 tests/error_conditions.cc \
77 tests/exist.cc \
78 tests/ketama.cc \
79 tests/mem_functions.cc \
80 tests/namespace.cc \
81 tests/parser.cc \
82 tests/touch.cc \
83 tests/callbacks.cc \
84 tests/pool.cc \
85 tests/print.cc \
86 tests/replication.cc \
87 tests/server_add.cc \
88 tests/virtual_buckets.cc
89 tests_testapp_SOURCES+= clients/generator.cc clients/execute.cc
90 tests_testapp_DEPENDENCIES= \
91 libmemcached/libmemcached.la \
92 libtest/libtest.la
93 libhashkit/libhashkit.la \
94 libmemcached/libmemcachedutil.la
95 tests_testapp_LDADD= \
96 ${PTHREAD_LIBS} \
97 libmemcached/libmemcached.la \
98 libmemcached/libmemcachedutil.la \
99 libtest/libtest.la \
100 libhashkit/libhashkit.la
101 check_PROGRAMS+= tests/testapp
102 noinst_PROGRAMS+= tests/testapp
103
104 tests_sasl_CXXFLAGS = $(AM_CXXFLAGS) ${PTHREAD_CFLAGS}
105 tests_sasl_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
106 tests_sasl_SOURCES= \
107 tests/basic.cc \
108 tests/debug.cc \
109 tests/deprecated.cc \
110 tests/error_conditions.cc \
111 tests/ketama.cc \
112 tests/sasl.cc \
113 tests/namespace.cc \
114 tests/parser.cc \
115 tests/pool.cc \
116 tests/print.cc \
117 tests/replication.cc \
118 tests/virtual_buckets.cc
119 tests_sasl_SOURCES+= clients/generator.cc clients/execute.cc
120 tests_sasl_DEPENDENCIES= \
121 libmemcached/libmemcached.la \
122 libtest/libtest.la
123 tests_sasl_LDADD= \
124 ${PTHREAD_LIBS} \
125 libmemcached/libmemcached.la \
126 libmemcached/libmemcachedutil.la \
127 libtest/libtest.la \
128 libhashkit/libhashkit.la
129 check_PROGRAMS+= tests/sasl
130 noinst_PROGRAMS+= tests/sasl
131
132 tests_testplus_SOURCES= tests/plus.cpp
133 tests_testplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
134 tests_testplus_DEPENDENCIES= $(TESTS_LDADDS)
135 tests_testplus_LDADD= $(tests_testplus_DEPENDENCIES)
136 check_PROGRAMS+= tests/testplus
137 noinst_PROGRAMS+= tests/testplus
138
139 tests_failure_SOURCES= tests/failure.cc
140 tests_failure_CXXFLAGS = $(AM_CXXFLAGS)
141 tests_failure_DEPENDENCIES= $(TESTS_LDADDS)
142 tests_failure_LDADD= $(tests_failure_DEPENDENCIES)
143 check_PROGRAMS+= tests/failure
144 noinst_PROGRAMS+= tests/failure
145
146 tests_atomsmasher_SOURCES= \
147 tests/atomsmasher.cc \
148 tests/debug.cc \
149 tests/print.cc \
150 clients/generator.cc \
151 clients/execute.cc
152 tests_atomsmasher_DEPENDENCIES= $(TESTS_LDADDS)
153 tests_atomsmasher_LDADD= $(tests_atomsmasher_DEPENDENCIES)
154 noinst_PROGRAMS+= tests/atomsmasher
155
156 tests_testudp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
157 tests_testudp_SOURCES= tests/mem_udp.cc
158 tests_testudp_DEPENDENCIES= $(TESTS_LDADDS)
159 tests_testudp_LDADD= $(tests_testudp_DEPENDENCIES)
160 check_PROGRAMS+= tests/testudp
161 noinst_PROGRAMS+= tests/testudp
162
163 tests_testhashkit_SOURCES = tests/hashkit_functions.cc
164 tests_testhashkit_DEPENDENCIES = libtest/libtest.la libhashkit/libhashkit.la $(TESTS_LDADDS)
165 tests_testhashkit_LDADD = $(tests_testhashkit_DEPENDENCIES)
166 check_PROGRAMS+= tests/testhashkit
167 noinst_PROGRAMS+= tests/testhashkit
168
169 tests_hash_plus_SOURCES= tests/hash_plus.cc
170 tests_hash_plus_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
171 tests_hash_plus_DEPENDENCIES= $(tests_testhashkit_DEPENDENCIES)
172 tests_hash_plus_LDADD= $(tests_testhashkit_DEPENDENCIES)
173 check_PROGRAMS+= tests/hash_plus
174 noinst_PROGRAMS+= tests/hash_plus
175
176 tests_memcapable_SOURCES= tests/memcapable.cc
177 tests_memcapable_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
178 tests_memcapable_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcapable
179 tests_memcapable_LDADD= libtest/libtest.la $(TESTS_LDADDS)
180 check_PROGRAMS+= tests/memcapable
181 noinst_PROGRAMS+= tests/memcapable
182
183 tests_memstat_SOURCES= tests/memstat.cc
184 tests_memstat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
185 tests_memstat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memstat
186 tests_memstat_LDADD= libtest/libtest.la $(TESTS_LDADDS)
187 check_PROGRAMS+= tests/memstat
188 noinst_PROGRAMS+= tests/memstat
189
190 tests_memcp_SOURCES= tests/memcp.cc
191 tests_memcp_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
192 tests_memcp_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcp
193 tests_memcp_LDADD= libtest/libtest.la $(TESTS_LDADDS)
194 check_PROGRAMS+= tests/memcp
195 noinst_PROGRAMS+= tests/memcp
196
197 tests_memflush_SOURCES= tests/memflush.cc
198 tests_memflush_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
199 tests_memflush_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memflush
200 tests_memflush_LDADD= libtest/libtest.la $(TESTS_LDADDS)
201 check_PROGRAMS+= tests/memflush
202 noinst_PROGRAMS+= tests/memflush
203
204 tests_memrm_SOURCES= tests/memrm.cc
205 tests_memrm_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
206 tests_memrm_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memrm
207 tests_memrm_LDADD= libtest/libtest.la $(TESTS_LDADDS)
208 check_PROGRAMS+= tests/memrm
209 noinst_PROGRAMS+= tests/memrm
210
211 tests_memexist_SOURCES= tests/memexist.cc
212 tests_memexist_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
213 tests_memexist_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memexist
214 tests_memexist_LDADD= libtest/libtest.la $(TESTS_LDADDS)
215 check_PROGRAMS+= tests/memexist
216 noinst_PROGRAMS+= tests/memexist
217
218 tests_memtouch_SOURCES= tests/memtouch.cc
219 tests_memtouch_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
220 tests_memtouch_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memtouch
221 tests_memtouch_LDADD= libtest/libtest.la $(TESTS_LDADDS)
222 check_PROGRAMS+= tests/memtouch
223 noinst_PROGRAMS+= tests/memtouch
224
225 tests_memcat_SOURCES= tests/memcat.cc
226 tests_memcat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
227 tests_memcat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcat
228 tests_memcat_LDADD= libtest/libtest.la $(TESTS_LDADDS)
229 check_PROGRAMS+= tests/memcat
230 noinst_PROGRAMS+= tests/memcat
231
232 tests_memerror_SOURCES= tests/memerror.cc
233 tests_memerror_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
234 tests_memerror_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memerror
235 tests_memerror_LDADD= libtest/libtest.la $(TESTS_LDADDS)
236 check_PROGRAMS+= tests/memerror
237 noinst_PROGRAMS+= tests/memerror
238
239 tests_memslap_SOURCES= tests/memslap.cc
240 tests_memslap_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
241 tests_memslap_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memslap
242 tests_memslap_LDADD= libtest/libtest.la $(TESTS_LDADDS)
243 check_PROGRAMS+= tests/memslap
244 noinst_PROGRAMS+= tests/memslap
245
246 tests_memdump_SOURCES= tests/memdump.cc
247 tests_memdump_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
248 tests_memdump_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memdump
249 tests_memdump_LDADD= libtest/libtest.la $(TESTS_LDADDS)
250 check_PROGRAMS+= tests/memdump
251 noinst_PROGRAMS+= tests/memdump
252
253 # Test linking with C application
254 tests_c_test_SOURCES= tests/c_test.c
255 tests_c_test_LDADD= libmemcached/libmemcached.la
256 tests_c_test_DEPENDENCIES= libmemcached/libmemcached.la
257 check_PROGRAMS+=tests/c_test
258 noinst_PROGRAMS+=tests/c_test
259
260 # Test linking with C application/SASL include
261 tests_c_sasl_test_SOURCES= tests/c_sasl_test.c
262 tests_c_sasl_test_LDADD= libmemcached/libmemcached.la
263 tests_c_sasl_test_DEPENDENCIES= libmemcached/libmemcached.la
264 check_PROGRAMS+=tests/c_sasl_test
265 noinst_PROGRAMS+=tests/c_sasl_test
266
267 test: check
268
269 check-local: $(TEST_DOCS)
270 @echo "Tests completed"
271
272 test-x: test-plus test-memcp test-memdump test-memflush test-memstat
273 @echo "Tests completed"
274
275 test-memcp: clients/memcp
276 @echo "Testing memcp"
277 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
278 @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
279 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
280 @rm tests/Xumemc.pid
281
282 valgrind-memcp: clients/memcat clients/memcp
283 @echo "Testing memcp"
284 @@MEMC_BINARY@ -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
285 @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
286 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
287 @rm tests/Xumemc.pid
288
289 test-memflush: clients/memflush
290 @echo "Testing memflush"
291 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
292 @clients/memflush --servers="localhost:12555"
293 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
294 @rm tests/Xumemc.pid
295
296 valgrind-memflush: clients/memflush
297 @echo "Testing memflush"
298 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
299 @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
300 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
301 @rm tests/Xumemc.pid
302
303 test-memdump: clients/memdump clients/memcp
304 @echo "Testing memdump"
305 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
306 @clients/memcp --servers="localhost:12555" clients/memcat
307 @clients/memdump --servers="localhost:12555" > /dev/null
308 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
309 @rm tests/Xumemc.pid
310
311 valgrind-memdump: clients/memcat clients/memcp
312 @echo "Testing memdump"
313 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
314 @clients/memcp --servers="localhost:12555" clients/memcat
315 @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
316 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
317 @rm tests/Xumemc.pid
318
319 test-memstat: clients/memstat
320 @echo "Testing memstat"
321 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
322 @clients/memstat --servers="localhost:12555" > /dev/null
323 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
324 @rm tests/Xumemc.pid
325
326 valgrind-memstat: clients/memstat
327 @echo "Testing memstat"
328 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
329 @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
330 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
331 @rm tests/Xumemc.pid
332
333 test-mem: tests/var tests/testapp
334 @tests/testapp
335
336 test-sasl: tests/sasl
337 @tests/sasl
338
339 test-atom: tests/var tests/atomsmasher
340 @tests/atomsmasher
341
342 test-plus: tests/var tests/testplus
343 @tests/testplus
344
345 test-hash: tests/var tests/testhashkit
346 @tests/testhashkit
347
348 test-hashplus: tests/var tests/hash_plus
349 @tests/hash_plus
350
351 test-cycle: tests/var tests/cycle
352 @tests/cycle
353
354 test-memcapable: tests/var tests/memcapable
355 @tests/memcapable
356
357 pahole-mem: tests/testapp
358 @$(PAHOLE_COMMAND) tests/testapp
359
360 gdb-mem: tests/testapp
361 @$(DEBUG_COMMAND) tests/testapp
362
363 gdb-sasl: tests/sasl
364 @$(DEBUG_COMMAND) tests/sasl
365
366 gdb-atom: tests/atomsmasher
367 @$(DEBUG_COMMAND) tests/testudp
368
369 gdb-udp: tests/testudp
370 @$(DEBUG_COMMAND) tests/atomsmasher
371
372 gdb-plus: tests/testplus
373 $(DEBUG_COMMAND) tests/testplus
374
375 gdb-hash: tests/testhashkit
376 @$(DEBUG_COMMAND) tests/testhashkit
377
378 gdb-hashplus: tests/hash_plus
379 @$(DEBUG_COMMAND) tests/hash_plus
380
381 gdb-cycle: tests/cycle
382 @$(DEBUG_COMMAND) tests/cycle
383
384 gdb-failure: tests/failure
385 @$(DEBUG_COMMAND) tests/failure
386
387 valgrind-cycle: tests/cycle
388 $(VALGRIND_COMMAND) tests/cycle
389
390 valgrind-mem: tests/testapp
391 @$(VALGRIND_COMMAND) tests/testapp
392
393 valgrind-failure: tests/failure
394 @$(VALGRIND_COMMAND) tests/failure
395
396 valgrind-atom: tests/atomsmasher
397 $(VALGRIND_COMMAND) tests/atomsmasher
398
399 valgrind-udp: tests/testudp
400 $(VALGRIND_COMMAND) tests/testudp
401
402 valgrind-plus: tests/testplus
403 @$(VALGRIND_COMMAND) tests/testplus
404
405 valgrind-sasl: tests/sasl
406 @$(VALGRIND_COMMAND) tests/sasl
407
408 valgrind-hash: tests/testhashkit
409 @$(VALGRIND_COMMAND) tests/testhashkit
410
411 valgrind-hashplus: tests/hash_plus
412 @$(VALGRIND_COMMAND) tests/hash_plus
413
414 helgrind-cycle: tests/cycle
415 @$(HELGRIND_COMMAND) tests/cycle
416
417 helgrind-mem: tests/testapp
418 @$(HELGRIND_COMMAND) tests/testapp
419
420 helgrind-atom: tests/atomsmasher
421 @$(HELGRIND_COMMAND) tests/atomsmasher
422
423 helgrind-udp: tests/testudp
424 @$(HELGRIND_COMMAND) tests/testudp
425
426 helgrind-plus: tests/testplus
427 @$(HELGRIND_COMMAND) tests/testplus
428
429 helgrind-hash: tests/testhashkit
430 @$(HELGRIND_COMMAND) tests/testhashkit
431
432 helgrind-hashplus: tests/hash_plus
433 @$(HELGRIND_COMMAND) tests/hash_plus