Partial encapsulation of memcached_st->hosts
[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 MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
123
124 HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
125
126 test-mem:
127 $(MEM_COMMAND)
128
129 test-hash:
130 $(HASH_COMMAND)
131
132 gdb-mem:
133 $(DEBUG_COMMAND) $(MEM_COMMAND)
134
135 gdb-hash:
136 $(DEBUG_COMMAND) $(HASH_COMMAND)
137
138 valgrind-mem:
139 $(VALGRIND_COMMAND) $(MEM_COMMAND)
140
141 valgrind-hash:
142 $(VALGRIND_COMMAND) $(HASH_COMMAND)
143
144
145 PHONY += valgrind
146 valgrind: tests/testapp tests/testhashkit valgrind-mem valgrind-hash
147
148 PHONY += cachegrind
149 CLEANFILES += tests/cachegrind.out
150 cachegrind:
151 rm -f tests/cachegrind.out.*
152 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
153 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
154
155 PHONY += callgrind
156 CLEANFILES += tests/callgrind.out
157 callgrind:
158 rm -f tests/callgrind.out.*
159 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
160 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
161
162 PHONY += helgrind
163 CLEANFILES+= helgrind.out.*
164 helgrind:
165 rm -f helgrind.out.*
166 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
167
168 PHONY += helgrind-slap
169 helgrind-slap:
170 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
171
172 test-no-outputdiff: test
173
174 hudson-valgrind:
175 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp