2 # Copyright (C) 2011 Data Differential
5 # Use and distribution licensed under the BSD license. See
6 # the COPYING file in the parent directory for full text.
8 # included from Top Level Makefile.am
9 # All paths should be given relative to the root
12 libmemcached/libmemcached.la \
13 libmemcached/libmemcachedutil.la \
16 DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb
18 PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole
21 tests/cpp_example.cc \
28 tests/error_conditions.h \
30 tests/hash_results.h \
32 tests/ketama_test_cases.h \
33 tests/ketama_test_cases_spy.h \
34 tests/libmemcached_world.h \
44 tests/virtual_buckets.h
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
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
70 tests_testapp_CXXFLAGS = $(AM_CXXFLAGS) ${PTHREAD_CFLAGS}
71 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
72 tests_testapp_SOURCES= \
76 tests/error_conditions.cc \
79 tests/mem_functions.cc \
86 tests/replication.cc \
88 tests/virtual_buckets.cc
89 tests_testapp_SOURCES+= clients/generator.cc clients/execute.cc
90 tests_testapp_DEPENDENCIES= \
91 libmemcached/libmemcached.la \
93 libhashkit/libhashkit.la \
94 libmemcached/libmemcachedutil.la
95 tests_testapp_LDADD= \
97 libmemcached/libmemcached.la \
98 libmemcached/libmemcachedutil.la \
100 libhashkit/libhashkit.la
101 check_PROGRAMS+= tests/testapp
102 noinst_PROGRAMS+= tests/testapp
104 tests_sasl_CXXFLAGS = $(AM_CXXFLAGS) ${PTHREAD_CFLAGS}
105 tests_sasl_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
106 tests_sasl_SOURCES= \
109 tests/deprecated.cc \
110 tests/error_conditions.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 \
125 libmemcached/libmemcached.la \
126 libmemcached/libmemcachedutil.la \
128 libhashkit/libhashkit.la
129 check_PROGRAMS+= tests/sasl
130 noinst_PROGRAMS+= tests/sasl
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
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
146 tests_atomsmasher_SOURCES= \
147 tests/atomsmasher.cc \
150 clients/generator.cc \
152 tests_atomsmasher_DEPENDENCIES= $(TESTS_LDADDS)
153 tests_atomsmasher_LDADD= $(tests_atomsmasher_DEPENDENCIES)
154 noinst_PROGRAMS+= tests/atomsmasher
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
269 check-local: $(TEST_DOCS)
270 @echo "Tests completed"
272 test-x: test-plus test-memcp test-memdump test-memflush test-memstat
273 @echo "Tests completed"
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"
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"
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"
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"
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"
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"
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"
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"
333 test-mem: tests/var tests/testapp
336 test-sasl: tests/sasl
339 test-atom: tests/var tests/atomsmasher
342 test-plus: tests/var tests/testplus
345 test-hash: tests/var tests/testhashkit
348 test-hashplus: tests/var tests/hash_plus
351 test-cycle: tests/var tests/cycle
354 test-memcapable: tests/var tests/memcapable
357 pahole-mem: tests/testapp
358 @$(PAHOLE_COMMAND) tests/testapp
360 gdb-mem: tests/testapp
361 @$(DEBUG_COMMAND) tests/testapp
364 @$(DEBUG_COMMAND) tests/sasl
366 gdb-atom: tests/atomsmasher
367 @$(DEBUG_COMMAND) tests/testudp
369 gdb-udp: tests/testudp
370 @$(DEBUG_COMMAND) tests/atomsmasher
372 gdb-plus: tests/testplus
373 $(DEBUG_COMMAND) tests/testplus
375 gdb-hash: tests/testhashkit
376 @$(DEBUG_COMMAND) tests/testhashkit
378 gdb-hashplus: tests/hash_plus
379 @$(DEBUG_COMMAND) tests/hash_plus
381 gdb-cycle: tests/cycle
382 @$(DEBUG_COMMAND) tests/cycle
384 gdb-failure: tests/failure
385 @$(DEBUG_COMMAND) tests/failure
387 valgrind-cycle: tests/cycle
388 $(VALGRIND_COMMAND) tests/cycle
390 valgrind-mem: tests/testapp
391 @$(VALGRIND_COMMAND) tests/testapp
393 valgrind-failure: tests/failure
394 @$(VALGRIND_COMMAND) tests/failure
396 valgrind-atom: tests/atomsmasher
397 $(VALGRIND_COMMAND) tests/atomsmasher
399 valgrind-udp: tests/testudp
400 $(VALGRIND_COMMAND) tests/testudp
402 valgrind-plus: tests/testplus
403 @$(VALGRIND_COMMAND) tests/testplus
405 valgrind-sasl: tests/sasl
406 @$(VALGRIND_COMMAND) tests/sasl
408 valgrind-hash: tests/testhashkit
409 @$(VALGRIND_COMMAND) tests/testhashkit
411 valgrind-hashplus: tests/hash_plus
412 @$(VALGRIND_COMMAND) tests/hash_plus
414 helgrind-cycle: tests/cycle
415 @$(HELGRIND_COMMAND) tests/cycle
417 helgrind-mem: tests/testapp
418 @$(HELGRIND_COMMAND) tests/testapp
420 helgrind-atom: tests/atomsmasher
421 @$(HELGRIND_COMMAND) tests/atomsmasher
423 helgrind-udp: tests/testudp
424 @$(HELGRIND_COMMAND) tests/testudp
426 helgrind-plus: tests/testplus
427 @$(HELGRIND_COMMAND) tests/testplus
429 helgrind-hash: tests/testhashkit
430 @$(HELGRIND_COMMAND) tests/testhashkit
432 helgrind-hashplus: tests/hash_plus
433 @$(HELGRIND_COMMAND) tests/hash_plus