Update test.c
[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 if BUILD_LIBMEMCACHEDUTIL
8 TESTS_LDADDS+= libmemcached/libmemcachedutil.la
9 endif
10
11 EXTRA_DIST+= \
12 tests/r/memcat.res \
13 tests/r/memcp.res \
14 tests/r/memrm.res \
15 tests/r/memslap.res \
16 tests/r/memstat.res \
17 tests/t/memcat.test \
18 tests/t/memcp.test \
19 tests/t/memrm.test \
20 tests/t/memslap.test \
21 tests/t/memstat.test
22
23 noinst_HEADERS+= \
24 tests/hash_results.h \
25 tests/ketama_test_cases.h \
26 tests/ketama_test_cases_spy.h \
27 tests/libmemcached_world.h \
28 tests/server.h \
29 tests/test.h
30
31 noinst_PROGRAMS+= \
32 tests/atomsmasher \
33 tests/startservers \
34 tests/testapp \
35 tests/testhashkit \
36 tests/testplus \
37 tests/udptest
38
39 noinst_LTLIBRARIES+= tests/libserver.la
40 tests_libserver_la_SOURCES= tests/server.c
41
42 noinst_LTLIBRARIES+= tests/libtest.la
43 tests_libtest_la_SOURCES= tests/test.c
44
45 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
46 tests_testapp_SOURCES= tests/function.c
47 tests_testapp_LDADD= \
48 clients/libgenexec.la \
49 tests/libserver.la \
50 tests/libtest.la \
51 $(TESTS_LDADDS)
52 tests_testapp_DEPENDENCIES= $(tests_testapp_LDADD)
53
54 tests_testplus_SOURCES= tests/plus.cpp
55 tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
56 tests_testplus_DEPENDENCIES= $(tests_testplus_LDADD)
57
58 tests_udptest_SOURCES= tests/udp.c
59 tests_udptest_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
60 tests_udptest_DEPENDENCIES= $(tests_udptest_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/testapp tests/testplus library_test memcapable libmhashkit_test
86 echo "Tests completed"
87
88 library_test:
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 gdb-mem:
118 $(LIBTOOL) --mode=execute gdb tests/testapp
119
120 gdb-hash:
121 $(LIBTOOL) --mode=execute gdb tests/testhashkit
122
123
124 PHONY += valgrind
125 valgrind:
126 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/testapp
127
128 PHONY += cachegrind
129 CLEANFILES += tests/cachegrind.out
130 cachegrind:
131 rm -f tests/cachegrind.out.*
132 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
133 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
134
135 PHONY += callgrind
136 CLEANFILES += tests/callgrind.out
137 callgrind:
138 rm -f tests/callgrind.out.*
139 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
140 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
141
142 PHONY += helgrind
143 CLEANFILES+= helgrind.out.*
144 helgrind:
145 rm -f helgrind.out.*
146 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
147
148 PHONY += helgrind-slap
149 helgrind-slap:
150 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
151
152 test-no-outputdiff: test
153
154 hudson-valgrind:
155 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp