be strict about port numbers being in in_port_t not uint32_t
[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 libmemcached/libmemcachedinternal.la \
52 $(TESTS_LDADDS)
53 tests_testapp_DEPENDENCIES= $(tests_testapp_LDADD)
54
55 tests_testplus_SOURCES= tests/plus.cpp
56 tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
57 tests_testplus_DEPENDENCIES= $(tests_testplus_LDADD)
58
59 tests_udptest_SOURCES= tests/udp.c
60 tests_udptest_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
61 tests_udptest_DEPENDENCIES= $(tests_udptest_LDADD)
62
63 tests_atomsmasher_SOURCES= tests/atomsmasher.c
64 tests_atomsmasher_LDADD= \
65 clients/libgenexec.la \
66 tests/libserver.la \
67 tests/libtest.la \
68 $(TESTS_LDADDS)
69 tests_atomsmasher_DEPENDENCIES= $(tests_atomsmasher_LDADD)
70
71 tests_startservers_SOURCES= tests/start.c
72 tests_startservers_LDADD= tests/libserver.la $(TESTS_LDADDS)
73 tests_startservers_DEPENDENCIES= $(tests_startservers_LDADD)
74
75 tests_testhashkit_SOURCES = tests/hashkit_functions.c
76 tests_testhashkit_LDADD = tests/libtest.la libhashkit/libhashkit.la
77 tests_testhashkit_DEPENDENCIES = $(tests_testhashkit_LDADD)
78
79 client-record:
80 sh tests/t/memcat.test > tests/r/memcat.res
81 sh tests/t/memcp.test > tests/r/memcp.res
82 sh tests/t/memrm.test > tests/r/memrm.res
83 sh tests/t/memslap.test > tests/r/memslap.res
84 sh tests/t/memstat.test > tests/r/memstat.res
85
86 test: test-docs tests/testapp tests/testplus library_test memcapable libmhashkit_test
87 echo "Tests completed"
88
89 library_test:
90 tests/testapp
91
92 libmhashkit_test: libhashkit
93 tests/testhashkit
94
95 memcapable: clients/memcapable
96 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
97 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
98 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
99 @rm tests/Xumemc.pid
100
101 PHONY += clients
102 clients:
103 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
104 export MEMCACHED_SERVERS="localhost:12555"
105 sh tests/t/memcat.test > tests/r/memcat.cmp
106 diff tests/r/memcat.res tests/r/memcat.cmp
107 sh tests/t/memcp.test > tests/r/memcp.cmp
108 diff tests/r/memcp.res tests/r/memcp.cmp
109 sh tests/t/memrm.test > tests/r/memrm.cmp
110 diff tests/r/memrm.res tests/r/memrm.cmp
111 sh tests/t/memslap.test > tests/r/memslap.cmp
112 diff tests/r/memslap.res tests/r/memslap.cmp
113 sh tests/t/memstat.test > tests/r/memstat.cmp
114 diff tests/r/memstat.res tests/r/memstat.cmp
115 cat tests/Xumemc.pid | xargs kill
116 rm tests/Xumemc.pid
117
118 gdb-mem:
119 $(LIBTOOL) --mode=execute gdb tests/testapp
120
121 gdb-hash:
122 $(LIBTOOL) --mode=execute gdb tests/testhashkit
123
124
125 PHONY += valgrind
126 valgrind:
127 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/testapp
128
129 PHONY += cachegrind
130 CLEANFILES += tests/cachegrind.out
131 cachegrind:
132 rm -f tests/cachegrind.out.*
133 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
134 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
135
136 PHONY += callgrind
137 CLEANFILES += tests/callgrind.out
138 callgrind:
139 rm -f tests/callgrind.out.*
140 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
141 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
142
143 PHONY += helgrind
144 CLEANFILES+= helgrind.out.*
145 helgrind:
146 rm -f helgrind.out.*
147 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
148
149 PHONY += helgrind-slap
150 helgrind-slap:
151 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
152
153 test-no-outputdiff: test
154
155 hudson-valgrind:
156 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp