Update tests for testplus.
[m6w6/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
8
9 DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb
10
11 if BUILD_LIBMEMCACHEDUTIL
12 TESTS_LDADDS+= libmemcached/libmemcachedutil.la
13 endif
14
15 EXTRA_DIST+= \
16 tests/r/memcat.res \
17 tests/r/memcp.res \
18 tests/r/memrm.res \
19 tests/r/memslap.res \
20 tests/r/memstat.res \
21 tests/t/memcat.test \
22 tests/t/memcp.test \
23 tests/t/memrm.test \
24 tests/t/memslap.test \
25 tests/t/memstat.test
26
27 noinst_HEADERS+= \
28 tests/hash_results.h \
29 tests/ketama_test_cases.h \
30 tests/ketama_test_cases_spy.h \
31 tests/libmemcached_world.h \
32 tests/server.h \
33 tests/test.h
34
35 noinst_PROGRAMS+= \
36 tests/atomsmasher \
37 tests/startservers \
38 tests/testapp \
39 tests/testhashkit \
40 tests/testplus
41
42 noinst_LTLIBRARIES+= tests/libserver.la
43 tests_libserver_la_SOURCES= tests/server.c
44
45 noinst_LTLIBRARIES+= tests/libtest.la
46 tests_libtest_la_SOURCES= tests/test.c
47
48 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
49 tests_testapp_SOURCES= tests/mem_functions.c
50 tests_testapp_LDADD= \
51 clients/libgenexec.la \
52 tests/libserver.la \
53 tests/libtest.la \
54 libmemcached/libmemcachedinternal.la \
55 $(TESTS_LDADDS)
56 tests_testapp_DEPENDENCIES= $(tests_testapp_LDADD)
57
58 tests_testplus_SOURCES= tests/plus.cpp
59 tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
60 tests_testplus_DEPENDENCIES= $(tests_testplus_LDADD)
61
62 tests_atomsmasher_SOURCES= tests/atomsmasher.c
63 tests_atomsmasher_LDADD= \
64 clients/libgenexec.la \
65 tests/libserver.la \
66 tests/libtest.la \
67 $(TESTS_LDADDS)
68 tests_atomsmasher_DEPENDENCIES= $(tests_atomsmasher_LDADD)
69
70 tests_startservers_SOURCES= tests/start.c
71 tests_startservers_LDADD= tests/libserver.la $(TESTS_LDADDS)
72 tests_startservers_DEPENDENCIES= $(tests_startservers_LDADD)
73
74 tests_testhashkit_SOURCES = tests/hashkit_functions.c
75 tests_testhashkit_LDADD = tests/libtest.la libhashkit/libhashkit.la
76 tests_testhashkit_DEPENDENCIES = $(tests_testhashkit_LDADD)
77
78 client-record:
79 sh tests/t/memcat.test > tests/r/memcat.res
80 sh tests/t/memcp.test > tests/r/memcp.res
81 sh tests/t/memrm.test > tests/r/memrm.res
82 sh tests/t/memslap.test > tests/r/memslap.res
83 sh tests/t/memstat.test > tests/r/memstat.res
84
85 test: test-docs tests/testplus library_test memcapable libmhashkit_test
86 echo "Tests completed"
87
88 library_test: tests/testapp
89 tests/testapp
90
91 libmhashkit_test: libhashkit
92 tests/testhashkit
93
94 memcapable: clients/memcapable
95 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
96 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
97 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
98 @rm tests/Xumemc.pid
99
100 PHONY += clients
101 clients:
102 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
103 export MEMCACHED_SERVERS="localhost:12555"
104 sh tests/t/memcat.test > tests/r/memcat.cmp
105 diff tests/r/memcat.res tests/r/memcat.cmp
106 sh tests/t/memcp.test > tests/r/memcp.cmp
107 diff tests/r/memcp.res tests/r/memcp.cmp
108 sh tests/t/memrm.test > tests/r/memrm.cmp
109 diff tests/r/memrm.res tests/r/memrm.cmp
110 sh tests/t/memslap.test > tests/r/memslap.cmp
111 diff tests/r/memslap.res tests/r/memslap.cmp
112 sh tests/t/memstat.test > tests/r/memstat.cmp
113 diff tests/r/memstat.res tests/r/memstat.cmp
114 cat tests/Xumemc.pid | xargs kill
115 rm tests/Xumemc.pid
116
117 MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE)
118
119 MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
120
121 PLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
122
123 ATOM_COMMAND= tests/atomsmasher $(COLLECTION) $(SUITE)
124
125 HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
126
127 test-mem: tests/testapp
128 $(MEM_COMMAND)
129
130 test-atom: tests/atomsmasher
131 $(ATOM_COMMAND)
132
133 test-plus: tests/testplus
134 $(PLUS_COMMAND)
135
136 test-hash: tests/testhashkit
137 $(HASH_COMMAND)
138
139 gdb-mem: tests/testapp
140 $(DEBUG_COMMAND) $(MEM_COMMAND)
141
142 gdb-atom: tests/atomsmasher
143 $(DEBUG_COMMAND) $(ATOM_COMMAND)
144
145 gdb-plus: tests/testplus
146 $(DEBUG_COMMAND) $(PLUS_COMMAND)
147
148 gdb-hash: tests/testhashkit
149 $(DEBUG_COMMAND) $(HASH_COMMAND)
150
151 gdb-memslap: clients/memslap
152 $(DEBUG_COMMAND) $(MEMSLAP_COMMAND)
153
154 valgrind-mem: tests/testapp
155 $(VALGRIND_COMMAND) $(MEM_COMMAND)
156
157 valgrind-atom: tests/atomsmasher
158 $(VALGRIND_COMMAND) $(ATOM_COMMAND)
159
160 valgrind-plus: tests/testplus
161 $(VALGRIND_COMMAND) $(PLUS_COMMAND)
162
163 valgrind-hash: tests/testhashkit
164 $(VALGRIND_COMMAND) $(HASH_COMMAND)
165
166 valgrind-memslap: clients/memslap
167 $(VALGRIND_COMMAND) $(MEMSLAP_COMMAND)
168
169 PHONY += valgrind
170 valgrind: tests/testapp tests/testhashkit valgrind-mem valgrind-hash
171
172 PHONY += cachegrind
173 CLEANFILES += tests/cachegrind.out
174 cachegrind:
175 rm -f tests/cachegrind.out.*
176 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
177 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
178
179 PHONY += callgrind
180 CLEANFILES += tests/callgrind.out
181 callgrind:
182 rm -f tests/callgrind.out.*
183 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
184 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
185
186 PHONY += helgrind
187 CLEANFILES+= helgrind.out.*
188 helgrind:
189 rm -f helgrind.out.*
190 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
191
192 PHONY += helgrind-slap
193 helgrind-slap:
194 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
195
196 test-no-outputdiff: test
197
198 hudson-valgrind: tests/testapp
199 $(VALGRIND_COMMAND) --log-file=tests/valgrind.out $(MEM_COMMAND)