Adding back libhashkit.
[m6w6/libmemcached] / tests / Makefile.am
1 LDADDS = $(top_builddir)/libmemcached/libmemcached.la
2
3 if BUILD_LIBMEMCACHEDUTIL
4 LDADDS+= $(top_builddir)/libmemcached/libmemcachedutil.la
5 endif
6
7 EXTRA_DIST = \
8 r/memcat.res\
9 r/memcp.res\
10 r/memrm.res\
11 r/memslap.res\
12 r/memstat.res\
13 t/memcat.test\
14 t/memcp.test\
15 t/memrm.test\
16 t/memslap.test\
17 t/memstat.test
18
19 LIBS =
20
21 noinst_HEADERS = test.h server.h ketama_test_cases.h ketama_test_cases_spy.h hash_results.h libmemcached_world.h
22 noinst_PROGRAMS = testapp testplus udptest atomsmasher startservers testhashkit
23 noinst_LTLIBRARIES= libserver.la libtest.la
24
25 libserver_la_SOURCES= server.c
26 libtest_la_SOURCES= test.c
27
28 testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
29 testapp_SOURCES = function.c
30 testapp_LDADD = $(top_builddir)/clients/libgenexec.la libtest.la libserver.la $(LDADDS)
31
32 testplus_SOURCES = plus.cpp
33 testplus_LDADD = libtest.la libserver.la $(LDADDS)
34
35 udptest_SOURCES = udp.c
36 udptest_LDADD = libtest.la libserver.la $(LDADDS)
37
38 atomsmasher_SOURCES = atomsmasher.c
39 atomsmasher_LDADD = $(top_builddir)/clients/libgenexec.la libtest.la libserver.la $(LDADDS)
40
41 startservers_SOURCES = start.c
42 startservers_LDADD = libserver.la $(LDADDS)
43
44 testhashkit_SOURCES = hashkit_functions.c
45 testhashkit_LDADD = libtest.la $(top_builddir)/libhashkit/libhashkit.la
46
47 client-record:
48 sh t/memcat.test > r/memcat.res
49 sh t/memcp.test > r/memcp.res
50 sh t/memrm.test > r/memrm.res
51 sh t/memslap.test > r/memslap.res
52 sh t/memstat.test > r/memstat.res
53
54 test: testapp testhashkit testplus library_test libmhashkit_test memcapable
55 echo "Tests completed"
56
57 library_test:
58 ./testapp
59
60 libmhashkit_test:
61 ./testhashkit
62
63 memcapable:
64 @MEMC_BINARY@ -d -P /tmp/Xumemc.pid -p 12555
65 @$(top_builddir)/clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
66 @cat /tmp/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
67 @rm /tmp/Xumemc.pid
68
69 clients:
70 @MEMC_BINARY@ -d -P /tmp/Xumemc.pid -p 12555
71 export MEMCACHED_SERVERS="localhost:12555"
72 sh t/memcat.test > r/memcat.cmp
73 diff r/memcat.res r/memcat.cmp
74 sh t/memcp.test > r/memcp.cmp
75 diff r/memcp.res r/memcp.cmp
76 sh t/memrm.test > r/memrm.cmp
77 diff r/memrm.res r/memrm.cmp
78 sh t/memslap.test > r/memslap.cmp
79 diff r/memslap.res r/memslap.cmp
80 sh t/memstat.test > r/memstat.cmp
81 diff r/memstat.res r/memstat.cmp
82 cat /tmp/Xumemc.pid | xargs kill
83 rm /tmp/Xumemc.pid
84
85 gdb-mem:
86 $(LIBTOOL) --mode=execute gdb testapp
87
88 gdb-hash:
89 $(LIBTOOL) --mode=execute gdb testhashkit
90
91 valgrind:
92 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes testapp
93
94 cachegrind:
95 rm -f cachegrind.out.*
96 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --branch-sim=yes testapp
97 cg_annotate cachegrind.out.* --auto=yes > /tmp/cachegrind.out
98
99 callgrind:
100 rm -f callgrind.out.*
101 $(LIBTOOL) --mode=execute valgrind --tool=callgrind testapp
102 callgrind_annotate callgrind.out.* --auto=yes > /tmp/callgrind.out
103
104 helgrind:
105 rm -f helgrind.out.*
106 $(LIBTOOL) --mode=execute valgrind --tool=helgrind testapp
107
108 helgrind-slap:
109 $(LIBTOOL) --mode=execute valgrind --tool=helgrind ${top_builddir}/clients/memslap --server=localhost --concurrency=30
110
111 test-no-outputdiff: test
112
113 hudson-valgrind:
114 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=/tmp/valgrind.out testapp