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