Ignore *.exe
[awesomized/libmemcached] / tests / include.am
1 # vim:ft=automake
2 # included from Top Level Makefile.am
3 # All paths should be given relative to the root
4
5 TESTS_LDADDS = libmemcached/libmemcached.la
6
7 VALGRIND_COMMAND= $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --track-fds=yes
8
9 DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb
10
11 PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole
12
13 if BUILD_LIBMEMCACHEDUTIL
14 TESTS_LDADDS+= libmemcached/libmemcachedutil.la
15 endif
16
17 noinst_HEADERS+= \
18 tests/hash_results.h \
19 tests/ketama_test_cases.h \
20 tests/ketama_test_cases_spy.h \
21 tests/libmemcached_world.h \
22 tests/server.h \
23 tests/test.h
24
25 noinst_PROGRAMS+= \
26 tests/atomsmasher \
27 tests/hashplus \
28 tests/memplus \
29 tests/startservers \
30 tests/testapp \
31 tests/testhashkit \
32 tests/testplus \
33 tests/testudp
34
35 noinst_LTLIBRARIES+= tests/libserver.la
36 tests_libserver_la_SOURCES= tests/server.c
37
38 noinst_LTLIBRARIES+= tests/libtest.la
39 tests_libtest_la_SOURCES= tests/test.c
40
41 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
42 tests_testapp_SOURCES= tests/mem_functions.c
43 tests_testapp_DEPENDENCIES= \
44 $(BUILT_SOURCES) \
45 clients/libgenexec.la \
46 tests/libserver.la \
47 tests/libtest.la \
48 libmemcached/libmemcachedinternal.la \
49 $(TESTS_LDADDS)
50 tests_testapp_LDADD= $(tests_testapp_DEPENDENCIES) $(LIBSASL)
51
52 tests_testplus_SOURCES= tests/plus.cpp
53 tests_testplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
54 tests_testplus_DEPENDENCIES= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
55 tests_testplus_LDADD= $(tests_testplus_DEPENDENCIES) $(LIBSASL)
56
57 tests_atomsmasher_SOURCES= tests/atomsmasher.c
58 tests_atomsmasher_DEPENDENCIES= \
59 clients/libgenexec.la \
60 tests/libserver.la \
61 tests/libtest.la \
62 $(TESTS_LDADDS)
63 tests_atomsmasher_LDADD= $(tests_atomsmasher_DEPENDENCIES) $(LIBSASL)
64
65 tests_testudp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
66 tests_testudp_SOURCES= tests/mem_udp.c
67 tests_testudp_DEPENDENCIES= \
68 clients/libgenexec.la \
69 tests/libserver.la \
70 tests/libtest.la \
71 $(TESTS_LDADDS)
72 tests_testudp_LDADD= $(tests_testudp_DEPENDENCIES) $(LIBSASL)
73
74 tests_startservers_SOURCES= tests/start.c
75 tests_startservers_DEPENDENCIES= tests/libserver.la $(TESTS_LDADDS)
76 tests_startservers_LDADD= $(tests_startservers_DEPENDENCIES) $(LIBSASL)
77
78 tests_testhashkit_SOURCES = tests/hashkit_functions.c
79 tests_testhashkit_DEPENDENCIES = tests/libtest.la libhashkit/libhashkit.la
80 tests_testhashkit_LDADD = $(tests_testhashkit_DEPENDENCIES) $(LIBSASL)
81
82 tests_hashplus_SOURCES = tests/hash_plus.cc
83 tests_hashplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
84 tests_hashplus_DEPENDENCIES = $(tests_testhashkit_DEPENDENCIES)
85 tests_hashplus_LDADD = $(tests_testhashkit_DEPENDENCIES) $(LIBSASL)
86
87 tests_memplus_SOURCES = tests/mem_plus.cc
88 tests_memplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
89 tests_memplus_DEPENDENCIES = tests/libtest.la tests/libserver.la libmemcached/libmemcached.la
90 tests_memplus_LDADD = $(tests_memplus_DEPENDENCIES) $(LIBSASL)
91
92 test: check
93
94 check-local: $(TEST_DOCS) test-mem test-hash memcapable
95 echo "Tests completed"
96
97 test-x: check-local test-plus test-memcat test-memcp test-memrm test-memerror test-memdump test-memflush test-memstat
98 echo "Tests completed"
99
100 memcapable: clients/memcapable
101 @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
102 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
103 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
104 @rm tests/Xumemc.pid
105
106 test-memcat: clients/memcat clients/memcp
107 @echo "Testing memcat"
108 @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
109 @clients/memcp --servers="localhost:12555" `pwd`/clients/memcp
110 @clients/memcat --servers="localhost:12555" memcp > `pwd`/tests/scratch
111 @clients/memcat --servers="localhost:12555" --file=`pwd`/tests/scratch2 memcp
112 # @diff clients/memcp tests/scratch
113 @cat `pwd`/tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
114 @rm `pwd`/tests/Xumemc.pid
115 @rm `pwd`/tests/scratch
116 @rm `pwd`/tests/scratch2
117
118 valgrind-memcat: clients/memcat clients/memcp
119 @echo "Testing memcat"
120 @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
121 @clients/memcp --servers="localhost:12555" clients/memcp
122 @$(VALGRIND_COMMAND) clients/memcat --servers="localhost:12555" memcp > tests/scratch
123 # @diff clients/memcp tests/scratch
124 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
125 @rm tests/Xumemc.pid
126 @rm tests/scratch
127
128 test-memcp: clients/memcp
129 @echo "Testing memcp"
130 @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
131 @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
132 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
133 @rm tests/Xumemc.pid
134
135 valgrind-memcp: clients/memcat clients/memcp
136 @echo "Testing memcp"
137 @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
138 @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
139 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
140 @rm tests/Xumemc.pid
141
142 test-memrm: clients/memrm clients/memcp
143 @echo "Testing memrm"
144 @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
145 @clients/memcp --servers="localhost:12555" clients/memcat
146 @clients/memrm --servers="localhost:12555" memcat
147 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
148 @rm tests/Xumemc.pid
149
150 valgrind-memrm: clients/memcat clients/memcp
151 @echo "Testing memrm"
152 @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
153 @clients/memcp --servers="localhost:12555" clients/memcat
154 @$(VALGRIND_COMMAND) clients/memrm --servers="localhost:12555" memcat
155 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
156 @rm tests/Xumemc.pid
157
158 test-memflush: clients/memflush
159 @echo "Testing memflush"
160 @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555
161 @clients/memflush --servers="localhost:12555"
162 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
163 @rm tests/Xumemc.pid
164
165 valgrind-memflush: clients/memflush
166 @echo "Testing memflush"
167 @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555
168 @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
169 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
170 @rm tests/Xumemc.pid
171
172 test-memdump: clients/memdump clients/memcp
173 @echo "Testing memdump"
174 @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555
175 @clients/memcp --servers="localhost:12555" clients/memcat
176 @clients/memdump --servers="localhost:12555" > /dev/null
177 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
178 @rm tests/Xumemc.pid
179
180 valgrind-memdump: clients/memcat clients/memcp
181 @echo "Testing memdump"
182 @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555
183 @clients/memcp --servers="localhost:12555" clients/memcat
184 @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
185 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
186 @rm tests/Xumemc.pid
187
188 test-memstat: clients/memstat
189 @echo "Testing memstat"
190 @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555
191 @clients/memstat --servers="localhost:12555" > /dev/null
192 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
193 @rm tests/Xumemc.pid
194
195 valgrind-memstat: clients/memstat
196 @echo "Testing memstat"
197 @$(MEMC_BINARY) -d -P `pwd`/tests/Xumemc.pid -p 12555
198 @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
199 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
200 @rm tests/Xumemc.pid
201
202 test-memerror: clients/memerror
203 @echo "Testing memerror"
204 @clients/memerror 0 > /dev/null
205
206 valgrind-memerror: clients/memerror
207 @echo "Testing memerror"
208 @$(VALGRIND_COMMAND) clients/memerror 0 > /dev/null
209
210
211
212
213
214 MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE)
215
216 MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
217
218 TESTPLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
219
220 MEMPLUS_COMMAND= tests/memplus $(COLLECTION) $(SUITE)
221
222 HASHPLUS_COMMAND= tests/hashplus $(COLLECTION) $(SUITE)
223
224 ATOM_COMMAND= tests/atomsmasher $(COLLECTION) $(SUITE)
225
226 UDP_COMMAND= tests/testudp $(COLLECTION) $(SUITE)
227
228 HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
229
230 test-mem: tests/testapp
231 $(MEM_COMMAND)
232
233 test-udp: tests/testudp
234 $(UDP_COMMAND)
235
236 test-atom: tests/atomsmasher
237 $(ATOM_COMMAND)
238
239 test-plus: tests/testplus
240 $(TESTPLUS_COMMAND)
241
242 test-hash: tests/testhashkit
243 $(HASH_COMMAND)
244
245 test-hashplus: tests/hashplus
246 $(HASHPLUS_COMMAND)
247
248 test-memplus: tests/memplus
249 $(MEMPLUS_COMMAND)
250
251 pahole-mem: tests/testapp
252 $(PAHOLE_COMMAND) $(MEM_COMMAND)
253
254 gdb-mem: tests/testapp
255 $(DEBUG_COMMAND) $(MEM_COMMAND)
256
257 gdb-atom: tests/atomsmasher
258 $(DEBUG_COMMAND) $(UDP_COMMAND)
259
260 gdb-udp: tests/testudp
261 $(DEBUG_COMMAND) $(ATOM_COMMAND)
262
263 gdb-plus: tests/testplus
264 $(DEBUG_COMMAND) $(TESTPLUS_COMMAND)
265
266 gdb-hash: tests/testhashkit
267 $(DEBUG_COMMAND) $(HASH_COMMAND)
268
269 gdb-hashplus: tests/hashplus
270 $(DEBUG_COMMAND) $(HASHPLUS_COMMAND)
271
272 gdb-memplus: tests/memplus
273 $(DEBUG_COMMAND) $(MEMPLUS_COMMAND)
274
275 gdb-memslap: clients/memslap
276 $(DEBUG_COMMAND) $(MEMSLAP_COMMAND)
277
278 valgrind-mem: tests/testapp
279 $(VALGRIND_COMMAND) $(MEM_COMMAND)
280
281 valgrind-atom: tests/atomsmasher
282 $(VALGRIND_COMMAND) $(ATOM_COMMAND)
283
284 valgrind-udp: tests/testudp
285 $(VALGRIND_COMMAND) $(UDP_COMMAND)
286
287 valgrind-plus: tests/testplus
288 $(VALGRIND_COMMAND) $(TESTPLUS_COMMAND)
289
290 valgrind-hash: tests/testhashkit
291 $(VALGRIND_COMMAND) $(HASH_COMMAND)
292
293 valgrind-hashplus: tests/hashplus
294 $(VALGRIND_COMMAND) $(HASHPLUS_COMMAND)
295
296 valgrind-memplus: tests/memplus
297 $(VALGRIND_COMMAND) $(MEMPLUS_COMMAND)
298
299 valgrind-memslap: clients/memslap
300 $(VALGRIND_COMMAND) $(MEMSLAP_COMMAND)
301
302 PHONY += valgrind
303 valgrind: tests/testapp tests/testhashkit valgrind-mem valgrind-hash valgrind-memcat valgrind-memcp valgrind-memrm valgrind-memerror valgrind-memdump valgrind-memflush valgrind-memstat
304
305 PHONY += cachegrind
306 CLEANFILES += tests/cachegrind.out
307 cachegrind:
308 rm -f tests/cachegrind.out.*
309 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
310 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
311
312 PHONY += callgrind
313 CLEANFILES += tests/callgrind.out
314 callgrind:
315 rm -f tests/callgrind.out.*
316 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
317 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
318
319 PHONY += helgrind
320 CLEANFILES+= helgrind.out.*
321 helgrind:
322 rm -f helgrind.out.*
323 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
324
325 PHONY += helgrind-slap
326 helgrind-slap:
327 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
328
329 test-no-outputdiff: test
330
331 hudson-valgrind: tests/testapp
332 $(VALGRIND_COMMAND) --log-file=tests/valgrind.out $(MEM_COMMAND)