2 # included from Top Level Makefile.am
3 # All paths should be given relative to the root
5 TESTS_LDADDS = libmemcached/libmemcached.la
7 if BUILD_LIBMEMCACHEDUTIL
8 TESTS_LDADDS+= libmemcached/libmemcachedutil.la
20 tests/t/memslap.test \
24 tests/hash_results.h \
25 tests/ketama_test_cases.h \
26 tests/ketama_test_cases_spy.h \
27 tests/libmemcached_world.h \
39 noinst_LTLIBRARIES+= tests/libserver.la
40 tests_libserver_la_SOURCES= tests/server.c
42 noinst_LTLIBRARIES+= tests/libtest.la
43 tests_libtest_la_SOURCES= tests/test.c
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 \
53 tests_testplus_SOURCES= tests/plus.cpp
54 tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
56 tests_udptest_SOURCES= tests/udp.c
57 tests_udptest_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
59 tests_atomsmasher_SOURCES= tests/atomsmasher.c
60 tests_atomsmasher_LDADD= \
61 clients/libgenexec.la \
66 tests_startservers_SOURCES= tests/start.c
67 tests_startservers_LDADD= tests/libserver.la $(TESTS_LDADDS)
69 tests_testhashkit_SOURCES = tests/hashkit_functions.c
70 tests_testhashkit_LDADD = tests/libtest.la libhashkit/libhashkit.la
71 tests_testhashkit_DEPENDENCIES = libhashkit
74 sh tests/t/memcat.test > tests/r/memcat.res
75 sh tests/t/memcp.test > tests/r/memcp.res
76 sh tests/t/memrm.test > tests/r/memrm.res
77 sh tests/t/memslap.test > tests/r/memslap.res
78 sh tests/t/memstat.test > tests/r/memstat.res
80 test: tests/testapp tests/testplus library_test memcapable libmhashkit_test
81 echo "Tests completed"
87 libmhashkit_test: libhashkit
90 memcapable: clients/memcapable
91 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
92 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
93 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
98 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
99 export MEMCACHED_SERVERS="localhost:12555"
100 sh tests/t/memcat.test > tests/r/memcat.cmp
101 diff tests/r/memcat.res tests/r/memcat.cmp
102 sh tests/t/memcp.test > tests/r/memcp.cmp
103 diff tests/r/memcp.res tests/r/memcp.cmp
104 sh tests/t/memrm.test > tests/r/memrm.cmp
105 diff tests/r/memrm.res tests/r/memrm.cmp
106 sh tests/t/memslap.test > tests/r/memslap.cmp
107 diff tests/r/memslap.res tests/r/memslap.cmp
108 sh tests/t/memstat.test > tests/r/memstat.cmp
109 diff tests/r/memstat.res tests/r/memstat.cmp
110 cat tests/Xumemc.pid | xargs kill
114 $(LIBTOOL) --mode=execute gdb tests/testapp
117 $(LIBTOOL) --mode=execute gdb tests/testhashkit
122 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/testapp
125 CLEANFILES += tests/cachegrind.out
127 rm -f tests/cachegrind.out.*
128 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
129 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
132 CLEANFILES += tests/callgrind.out
134 rm -f tests/callgrind.out.*
135 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
136 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
139 CLEANFILES+= helgrind.out.*
142 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
144 PHONY += helgrind-slap
146 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
148 test-no-outputdiff: test
151 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp