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 \
26 tests/hash_results.h \
27 tests/libmemcached_world.h
29 # Cycle should always run first
30 tests_cycle_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
31 tests_cycle_CXXFLAGS= $(AM_CXXFLAGS)
32 tests_cycle_CXXFLAGS+= ${PTHREAD_CFLAGS}
33 tests_cycle_SOURCES= tests/cycle.cc
34 tests_cycle_DEPENDENCIES= $(TESTS_LDADDS)
35 tests_cycle_LDADD= $(tests_cycle_DEPENDENCIES)
36 tests_cycle_LDADD+= ${PTHREAD_LIBS}
37 check_PROGRAMS+= tests/cycle
38 noinst_PROGRAMS+= tests/cycle
40 include tests/libmemcached-1.0/include.am
42 tests_failure_SOURCES= tests/failure.cc
43 tests_failure_CXXFLAGS = $(AM_CXXFLAGS)
44 tests_failure_DEPENDENCIES= $(TESTS_LDADDS)
45 tests_failure_LDADD= $(tests_failure_DEPENDENCIES)
46 check_PROGRAMS+= tests/failure
47 noinst_PROGRAMS+= tests/failure
49 tests_testhashkit_SOURCES = tests/hashkit_functions.cc
50 tests_testhashkit_DEPENDENCIES = libtest/libtest.la libhashkit/libhashkit.la $(TESTS_LDADDS)
51 tests_testhashkit_LDADD = $(tests_testhashkit_DEPENDENCIES)
52 check_PROGRAMS+= tests/testhashkit
53 noinst_PROGRAMS+= tests/testhashkit
55 tests_hash_plus_SOURCES= tests/hash_plus.cc
56 tests_hash_plus_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
57 tests_hash_plus_DEPENDENCIES= $(tests_testhashkit_DEPENDENCIES)
58 tests_hash_plus_LDADD= $(tests_testhashkit_DEPENDENCIES)
59 check_PROGRAMS+= tests/hash_plus
60 noinst_PROGRAMS+= tests/hash_plus
62 tests_memcapable_SOURCES= tests/memcapable.cc
63 tests_memcapable_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
64 tests_memcapable_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcapable
65 tests_memcapable_LDADD= libtest/libtest.la $(TESTS_LDADDS)
66 check_PROGRAMS+= tests/memcapable
67 noinst_PROGRAMS+= tests/memcapable
69 tests_memstat_SOURCES= tests/memstat.cc
70 tests_memstat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
71 tests_memstat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memstat
72 tests_memstat_LDADD= libtest/libtest.la $(TESTS_LDADDS)
73 check_PROGRAMS+= tests/memstat
74 noinst_PROGRAMS+= tests/memstat
76 tests_memcp_SOURCES= tests/memcp.cc
77 tests_memcp_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
78 tests_memcp_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcp
79 tests_memcp_LDADD= libtest/libtest.la $(TESTS_LDADDS)
80 check_PROGRAMS+= tests/memcp
81 noinst_PROGRAMS+= tests/memcp
83 tests_memflush_SOURCES= tests/memflush.cc
84 tests_memflush_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
85 tests_memflush_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memflush
86 tests_memflush_LDADD= libtest/libtest.la $(TESTS_LDADDS)
87 check_PROGRAMS+= tests/memflush
88 noinst_PROGRAMS+= tests/memflush
90 tests_memrm_SOURCES= tests/memrm.cc
91 tests_memrm_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
92 tests_memrm_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memrm
93 tests_memrm_LDADD= libtest/libtest.la $(TESTS_LDADDS)
94 check_PROGRAMS+= tests/memrm
95 noinst_PROGRAMS+= tests/memrm
97 tests_memexist_SOURCES= tests/memexist.cc
98 tests_memexist_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
99 tests_memexist_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memexist
100 tests_memexist_LDADD= libtest/libtest.la $(TESTS_LDADDS)
101 check_PROGRAMS+= tests/memexist
102 noinst_PROGRAMS+= tests/memexist
104 tests_memtouch_SOURCES= tests/memtouch.cc
105 tests_memtouch_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
106 tests_memtouch_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memtouch
107 tests_memtouch_LDADD= libtest/libtest.la $(TESTS_LDADDS)
108 check_PROGRAMS+= tests/memtouch
109 noinst_PROGRAMS+= tests/memtouch
111 tests_memcat_SOURCES= tests/memcat.cc
112 tests_memcat_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
113 tests_memcat_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memcat
114 tests_memcat_LDADD= libtest/libtest.la $(TESTS_LDADDS)
115 check_PROGRAMS+= tests/memcat
116 noinst_PROGRAMS+= tests/memcat
118 tests_memerror_SOURCES= tests/memerror.cc
119 tests_memerror_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
120 tests_memerror_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memerror
121 tests_memerror_LDADD= libtest/libtest.la $(TESTS_LDADDS)
122 check_PROGRAMS+= tests/memerror
123 noinst_PROGRAMS+= tests/memerror
125 tests_memslap_SOURCES= tests/memslap.cc
126 tests_memslap_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
127 tests_memslap_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memslap
128 tests_memslap_LDADD= libtest/libtest.la $(TESTS_LDADDS)
129 check_PROGRAMS+= tests/memslap
130 noinst_PROGRAMS+= tests/memslap
132 tests_memdump_SOURCES= tests/memdump.cc
133 tests_memdump_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX)
134 tests_memdump_DEPENDENCIES= libtest/libtest.la $(TESTS_LDADDS) clients/memdump
135 tests_memdump_LDADD= libtest/libtest.la $(TESTS_LDADDS)
136 check_PROGRAMS+= tests/memdump
137 noinst_PROGRAMS+= tests/memdump
141 check-local: $(TEST_DOCS)
142 @echo "Tests completed"
144 test-x: test-plus test-memcp test-memdump test-memflush test-memstat
145 @echo "Tests completed"
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"
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"
161 test-memflush: clients/memflush
162 @echo "Testing memflush"
163 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
164 @clients/memflush --servers="localhost:12555"
165 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
168 valgrind-memflush: clients/memflush
169 @echo "Testing memflush"
170 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
171 @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
172 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
175 test-memdump: clients/memdump clients/memcp
176 @echo "Testing memdump"
177 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
178 @clients/memcp --servers="localhost:12555" clients/memcat
179 @clients/memdump --servers="localhost:12555" > /dev/null
180 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
183 valgrind-memdump: clients/memcat clients/memcp
184 @echo "Testing memdump"
185 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
186 @clients/memcp --servers="localhost:12555" clients/memcat
187 @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
188 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
191 test-memstat: clients/memstat
192 @echo "Testing memstat"
193 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
194 @clients/memstat --servers="localhost:12555" > /dev/null
195 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
198 valgrind-memstat: clients/memstat
199 @echo "Testing memstat"
200 @$(MEMC_BINARY) -d -u root -P `pwd`/tests/Xumemc.pid -p 12555
201 @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
202 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
205 test-mem: tests/var tests/testapp
208 test-sasl: tests/sasl
211 test-atom: tests/var tests/atomsmasher
214 test-plus: tests/var tests/testplus
217 test-hash: tests/var tests/testhashkit
220 test-hashplus: tests/var tests/hash_plus
223 test-cycle: tests/var tests/cycle
226 test-memcapable: tests/var tests/memcapable
229 pahole-mem: tests/testapp
230 @$(PAHOLE_COMMAND) tests/testapp
232 gdb-mem: tests/testapp
233 @$(DEBUG_COMMAND) tests/testapp
236 @$(DEBUG_COMMAND) tests/sasl
238 gdb-atom: tests/atomsmasher
239 @$(DEBUG_COMMAND) tests/atomsmasher
241 gdb-udp: tests/testudp
242 @$(DEBUG_COMMAND) tests/testudp
244 gdb-plus: tests/testplus
245 $(DEBUG_COMMAND) tests/testplus
247 gdb-hash: tests/testhashkit
248 @$(DEBUG_COMMAND) tests/testhashkit
250 gdb-hashplus: tests/hash_plus
251 @$(DEBUG_COMMAND) tests/hash_plus
253 gdb-cycle: tests/cycle
254 @$(DEBUG_COMMAND) tests/cycle
256 gdb-failure: tests/failure
257 @$(DEBUG_COMMAND) tests/failure
259 valgrind-cycle: tests/cycle
260 $(VALGRIND_COMMAND) tests/cycle
262 valgrind-mem: tests/testapp
263 @$(VALGRIND_COMMAND) tests/testapp
265 valgrind-failure: tests/failure
266 @$(VALGRIND_COMMAND) tests/failure
268 valgrind-atom: tests/atomsmasher
269 $(VALGRIND_COMMAND) tests/atomsmasher
271 valgrind-udp: tests/testudp
272 $(VALGRIND_COMMAND) tests/testudp
274 valgrind-plus: tests/testplus
275 @$(VALGRIND_COMMAND) tests/testplus
277 valgrind-sasl: tests/sasl
278 @$(VALGRIND_COMMAND) tests/sasl
280 valgrind-hash: tests/testhashkit
281 @$(VALGRIND_COMMAND) tests/testhashkit
283 valgrind-hashplus: tests/hash_plus
284 @$(VALGRIND_COMMAND) tests/hash_plus
286 helgrind-cycle: tests/cycle
287 @$(HELGRIND_COMMAND) tests/cycle
289 helgrind-mem: tests/testapp
290 @$(HELGRIND_COMMAND) tests/testapp
292 helgrind-atom: tests/atomsmasher
293 @$(HELGRIND_COMMAND) tests/atomsmasher
295 helgrind-udp: tests/testudp
296 @$(HELGRIND_COMMAND) tests/testudp
298 helgrind-plus: tests/testplus
299 @$(HELGRIND_COMMAND) tests/testplus
301 helgrind-hash: tests/testhashkit
302 @$(HELGRIND_COMMAND) tests/testhashkit
304 helgrind-hashplus: tests/hash_plus
305 @$(HELGRIND_COMMAND) tests/hash_plus