Work inspired by matt knox
[m6w6/libmemcached] / tests / Makefile.am
1 LDADDS = $(top_builddir)/libmemcached/libmemcached.la
2
3 if BUILD_LIBMEMCACHEDUTIL
4 LDADDS+= $(top_builddir)/libmemcachedutil/libmemcachedutil.la
5 endif
6
7 EXTRA_DIST = output.res output2.res\
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
22 noinst_PROGRAMS = testapp testplus udptest atomsmasher startservers
23
24 testapp_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION}
25 testapp_SOURCES = test.c function.c server.c ../clients/generator.c ../clients/execute.c
26 testapp_LDADD = $(LDADDS)
27
28 testplus_SOURCES = test.c plus.cpp server.c
29 testplus_LDADD = $(LDADDS)
30
31 udptest_SOURCES = test.c udp.c server.c
32 udptest_LDADD = $(LDADDS)
33
34 atomsmasher_SOURCES = test.c atomsmasher.c server.c ../clients/generator.c ../clients/execute.c
35 atomsmasher_LDADD = $(LDADDS)
36
37 startservers_SOURCES = start.c server.c
38 startservers_LDADD = $(LDADDS)
39
40 record:
41 ./testapp > output.res
42
43 client-record:
44 sh t/memcat.test > r/memcat.res
45 sh t/memcp.test > r/memcp.res
46 sh t/memrm.test > r/memrm.res
47 sh t/memslap.test > r/memslap.res
48 sh t/memstat.test > r/memstat.res
49
50 record-extended:
51 ./testapp extended > output2.res
52
53 test: testapp library_test
54 echo "Tests completed"
55
56 library_test:
57 ./testapp > output.cmp
58 diff output.res output.cmp
59
60 clients:
61 memcached -d -P /tmp/Xumemc.pid -p 12555
62 export MEMCACHED_SERVERS="localhost:12555"
63 sh t/memcat.test > r/memcat.cmp
64 diff r/memcat.res r/memcat.cmp
65 sh t/memcp.test > r/memcp.cmp
66 diff r/memcp.res r/memcp.cmp
67 sh t/memrm.test > r/memrm.cmp
68 diff r/memrm.res r/memrm.cmp
69 sh t/memslap.test > r/memslap.cmp
70 diff r/memslap.res r/memslap.cmp
71 sh t/memstat.test > r/memstat.cmp
72 diff r/memstat.res r/memstat.cmp
73 cat /tmp/Xumemc.pid | xargs kill
74 rm /tmp/Xumemc.pid
75
76 valgrind:
77 libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes testapp
78
79 cachegrind:
80 rm -f cachegrind.out.*
81 libtool --mode=execute valgrind --tool=cachegrind --branch-sim=yes testapp
82 cg_annotate cachegrind.out.* --auto=yes > /tmp/cachegrind.out
83
84 callgrind:
85 rm -f callgrind.out.*
86 libtool --mode=execute valgrind --tool=callgrind testapp
87 callgrind_annotate callgrind.out.* --auto=yes > /tmp/callgrind.out
88
89 helgrind:
90 rm -f helgrind.out.*
91 libtool --mode=execute valgrind --tool=helgrind testapp
92
93 helgrind-slap:
94 libtool --mode=execute valgrind --tool=helgrind ../clients/memslap --server=localhost --concurrency=30
95
96 test-no-outputdiff: testapp
97 ./testapp > /dev/null
98 @echo "Test completed"