-P seems to want an abs path.
[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/testplus \
36 tests/udptest
37
38 noinst_LTLIBRARIES+= tests/libserver.la
39 tests_libserver_la_SOURCES= tests/server.c
40
41 noinst_LTLIBRARIES+= tests/libtest.la
42 tests_libtest_la_SOURCES= tests/test.c
43
44 tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
45 tests_testapp_SOURCES= tests/function.c
46 tests_testapp_LDADD= \
47 clients/libgenexec.la \
48 tests/libserver.la \
49 tests/libtest.la \
50 $(TESTS_LDADDS)
51
52 tests_testplus_SOURCES= tests/plus.cpp
53 tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
54
55 tests_udptest_SOURCES= tests/udp.c
56 tests_udptest_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS)
57
58 tests_atomsmasher_SOURCES= tests/atomsmasher.c
59 tests_atomsmasher_LDADD= \
60 clients/libgenexec.la \
61 tests/libserver.la \
62 tests/libtest.la \
63 $(TESTS_LDADDS)
64
65 tests_startservers_SOURCES= tests/start.c
66 tests_startservers_LDADD= tests/libserver.la $(TESTS_LDADDS)
67
68 client-record:
69 sh tests/t/memcat.test > tests/r/memcat.res
70 sh tests/t/memcp.test > tests/r/memcp.res
71 sh tests/t/memrm.test > tests/r/memrm.res
72 sh tests/t/memslap.test > tests/r/memslap.res
73 sh tests/t/memstat.test > tests/r/memstat.res
74
75 test: tests/testapp tests/testplus library_test memcapable
76 echo "Tests completed"
77
78 library_test:
79 tests/testapp
80 # tests/testplus
81
82 memcapable: clients/memcapable
83 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
84 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands"
85 @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
86 @rm tests/Xumemc.pid
87
88 PHONY += clients
89 clients:
90 @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
91 export MEMCACHED_SERVERS="localhost:12555"
92 sh tests/t/memcat.test > tests/r/memcat.cmp
93 diff tests/r/memcat.res tests/r/memcat.cmp
94 sh tests/t/memcp.test > tests/r/memcp.cmp
95 diff tests/r/memcp.res tests/r/memcp.cmp
96 sh tests/t/memrm.test > tests/r/memrm.cmp
97 diff tests/r/memrm.res tests/r/memrm.cmp
98 sh tests/t/memslap.test > tests/r/memslap.cmp
99 diff tests/r/memslap.res tests/r/memslap.cmp
100 sh tests/t/memstat.test > tests/r/memstat.cmp
101 diff tests/r/memstat.res tests/r/memstat.cmp
102 cat tests/Xumemc.pid | xargs kill
103 rm tests/Xumemc.pid
104
105 PHONY += valgrind
106 valgrind:
107 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/testapp
108
109 PHONY += cachegrind
110 CLEANFILES += tests/cachegrind.out
111 cachegrind:
112 rm -f tests/cachegrind.out.*
113 $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp
114 cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out
115
116 PHONY += callgrind
117 CLEANFILES += tests/callgrind.out
118 callgrind:
119 rm -f tests/callgrind.out.*
120 $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp
121 callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out
122
123 PHONY += helgrind
124 CLEANFILES+= helgrind.out.*
125 helgrind:
126 rm -f helgrind.out.*
127 $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp
128
129 PHONY += helgrind-slap
130 helgrind-slap:
131 $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30
132
133 test-no-outputdiff: test
134
135 hudson-valgrind:
136 $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp