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