Modify where memslap keeps its default config file.
[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 tests/udptest
42
43 noinst_LTLIBRARIES+= tests/libserver.la
44 tests_libserver_la_SOURCES= tests/server.c
45
46 noinst_LTLIBRARIES+= tests/libtest.la
47 tests_libtest_la_SOURCES= tests/test.c
48
49 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
50 tests_testapp_SOURCES= tests/mem_functions.c
51 tests_testapp_LDADD= \
52 clients/libgenexec.la \
53 tests/libserver.la \
54 tests/libtest.la \
55 libmemcached/libmemcachedinternal.la \
56 $(TESTS_LDADDS)
57 tests_testapp_DEPENDENCIES= $(tests_testapp_LDADD)
58
59 tests_testplus_SOURCES= tests/plus.cpp
60 tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
61 tests_testplus_DEPENDENCIES= $(tests_testplus_LDADD)
62
63 tests_udptest_SOURCES= tests/udp.c
64 tests_udptest_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
65 tests_udptest_DEPENDENCIES= $(tests_udptest_LDADD)
66
67 tests_atomsmasher_SOURCES= tests/atomsmasher.c
68 tests_atomsmasher_LDADD= \
69 clients/libgenexec.la \
70 tests/libserver.la \
71 tests/libtest.la \
72 $(TESTS_LDADDS)
73 tests_atomsmasher_DEPENDENCIES= $(tests_atomsmasher_LDADD)
74
75 tests_startservers_SOURCES= tests/start.c
76 tests_startservers_LDADD= tests/libserver.la $(TESTS_LDADDS)
77 tests_startservers_DEPENDENCIES= $(tests_startservers_LDADD)
78
79 tests_testhashkit_SOURCES = tests/hashkit_functions.c
80 tests_testhashkit_LDADD = tests/libtest.la libhashkit/libhashkit.la
81 tests_testhashkit_DEPENDENCIES = $(tests_testhashkit_LDADD)
82
83 client-record:
84 sh tests/t/memcat.test > tests/r/memcat.res
85 sh tests/t/memcp.test > tests/r/memcp.res
86 sh tests/t/memrm.test > tests/r/memrm.res
87 sh tests/t/memslap.test > tests/r/memslap.res
88 sh tests/t/memstat.test > tests/r/memstat.res
89
90 test: test-docs tests/testplus library_test memcapable libmhashkit_test
91 echo "Tests completed"
92
93 library_test: tests/testapp
94 tests/testapp
95
96 libmhashkit_test: libhashkit
97 tests/testhashkit
98
99 memcapable: clients/memcapable
100 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
101 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
102 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
103 @rm tests/Xumemc.pid
104
105 PHONY += clients
106 clients:
107 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
108 export MEMCACHED_SERVERS="localhost:12555"
109 sh tests/t/memcat.test > tests/r/memcat.cmp
110 diff tests/r/memcat.res tests/r/memcat.cmp
111 sh tests/t/memcp.test > tests/r/memcp.cmp
112 diff tests/r/memcp.res tests/r/memcp.cmp
113 sh tests/t/memrm.test > tests/r/memrm.cmp
114 diff tests/r/memrm.res tests/r/memrm.cmp
115 sh tests/t/memslap.test > tests/r/memslap.cmp
116 diff tests/r/memslap.res tests/r/memslap.cmp
117 sh tests/t/memstat.test > tests/r/memstat.cmp
118 diff tests/r/memstat.res tests/r/memstat.cmp
119 cat tests/Xumemc.pid | xargs kill
120 rm tests/Xumemc.pid
121
122 MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE)
123
124 MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
125
126 HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
127
128 test-mem:
129 $(MEM_COMMAND)
130
131 test-hash:
132 $(HASH_COMMAND)
133
134 gdb-mem:
135 $(DEBUG_COMMAND) $(MEM_COMMAND)
136
137 gdb-hash:
138 $(DEBUG_COMMAND) $(HASH_COMMAND)
139
140 gdb-memslap:
141 $(DEBUG_COMMAND) $(MEMSLAP_COMMAND)
142
143 valgrind-mem:
144 $(VALGRIND_COMMAND) $(MEM_COMMAND)
145
146 valgrind-hash:
147 $(VALGRIND_COMMAND) $(HASH_COMMAND)
148
149 valgrind-memslap:
150 $(VALGRIND_COMMAND) $(MEMSLAP_COMMAND)
151
152 PHONY += valgrind
153 valgrind: tests/testapp tests/testhashkit valgrind-mem valgrind-hash
154
155 PHONY += cachegrind
156 CLEANFILES += tests/cachegrind.out
157 cachegrind:
158 rm -f tests/cachegrind.out.*
159 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
160 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
161
162 PHONY += callgrind
163 CLEANFILES += tests/callgrind.out
164 callgrind:
165 rm -f tests/callgrind.out.*
166 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
167 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
168
169 PHONY += helgrind
170 CLEANFILES+= helgrind.out.*
171 helgrind:
172 rm -f helgrind.out.*
173 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
174
175 PHONY += helgrind-slap
176 helgrind-slap:
177 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
178
179 test-no-outputdiff: test
180
181 hudson-valgrind:
182 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp