X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Finclude.am;h=259da130cfd70f9d475ab0aae161e55c98d7bcbc;hb=d38a24defa282f8c05835c16ad1633ffb528d82c;hp=9c0ec5cfceb45429da95486b60d583272dff314d;hpb=c801828a5a8937eeb9c008135185a6b5ab6199a9;p=m6w6%2Flibmemcached diff --git a/tests/include.am b/tests/include.am index 9c0ec5cf..259da130 100644 --- a/tests/include.am +++ b/tests/include.am @@ -4,36 +4,41 @@ TESTS_LDADDS = libmemcached/libmemcached.la +VALGRIND_COMMAND= $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes + +DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb + if BUILD_LIBMEMCACHEDUTIL TESTS_LDADDS+= libmemcached/libmemcachedutil.la endif EXTRA_DIST+= \ - tests/r/memcat.res \ - tests/r/memcp.res \ - tests/r/memrm.res \ - tests/r/memslap.res \ - tests/r/memstat.res \ - tests/t/memcat.test \ - tests/t/memcp.test \ - tests/t/memrm.test \ - tests/t/memslap.test \ - tests/t/memstat.test + tests/r/memcat.res \ + tests/r/memcp.res \ + tests/r/memrm.res \ + tests/r/memslap.res \ + tests/r/memstat.res \ + tests/t/memcat.test \ + tests/t/memcp.test \ + tests/t/memrm.test \ + tests/t/memslap.test \ + tests/t/memstat.test noinst_HEADERS+= \ - tests/hash_results.h \ - tests/ketama_test_cases.h \ - tests/ketama_test_cases_spy.h \ - tests/libmemcached_world.h \ - tests/server.h \ - tests/test.h + tests/hash_results.h \ + tests/ketama_test_cases.h \ + tests/ketama_test_cases_spy.h \ + tests/libmemcached_world.h \ + tests/server.h \ + tests/test.h noinst_PROGRAMS+= \ - tests/atomsmasher \ - tests/startservers \ - tests/testapp \ - tests/testplus \ - tests/udptest + tests/atomsmasher \ + tests/startservers \ + tests/testapp \ + tests/testhashkit \ + tests/testplus \ + tests/udptest noinst_LTLIBRARIES+= tests/libserver.la tests_libserver_la_SOURCES= tests/server.c @@ -42,18 +47,22 @@ noinst_LTLIBRARIES+= tests/libtest.la tests_libtest_la_SOURCES= tests/test.c tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING) -tests_testapp_SOURCES= tests/function.c +tests_testapp_SOURCES= tests/mem_functions.c tests_testapp_LDADD= \ clients/libgenexec.la \ tests/libserver.la \ tests/libtest.la \ + libmemcached/libmemcachedinternal.la \ $(TESTS_LDADDS) +tests_testapp_DEPENDENCIES= $(tests_testapp_LDADD) tests_testplus_SOURCES= tests/plus.cpp tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS) +tests_testplus_DEPENDENCIES= $(tests_testplus_LDADD) tests_udptest_SOURCES= tests/udp.c tests_udptest_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS) +tests_udptest_DEPENDENCIES= $(tests_udptest_LDADD) tests_atomsmasher_SOURCES= tests/atomsmasher.c tests_atomsmasher_LDADD= \ @@ -61,9 +70,15 @@ tests_atomsmasher_LDADD= \ tests/libserver.la \ tests/libtest.la \ $(TESTS_LDADDS) +tests_atomsmasher_DEPENDENCIES= $(tests_atomsmasher_LDADD) tests_startservers_SOURCES= tests/start.c tests_startservers_LDADD= tests/libserver.la $(TESTS_LDADDS) +tests_startservers_DEPENDENCIES= $(tests_startservers_LDADD) + +tests_testhashkit_SOURCES = tests/hashkit_functions.c +tests_testhashkit_LDADD = tests/libtest.la libhashkit/libhashkit.la +tests_testhashkit_DEPENDENCIES = $(tests_testhashkit_LDADD) client-record: sh tests/t/memcat.test > tests/r/memcat.res @@ -72,22 +87,24 @@ client-record: sh tests/t/memslap.test > tests/r/memslap.res sh tests/t/memstat.test > tests/r/memstat.res -test: tests/testapp tests/testplus library_test memcapable +test: test-docs tests/testplus library_test memcapable libmhashkit_test echo "Tests completed" -library_test: +library_test: tests/testapp tests/testapp -# tests/testplus + +libmhashkit_test: libhashkit + tests/testhashkit memcapable: clients/memcapable - @MEMC_BINARY@ -d -P tests/Xumemc.pid -p 12555 + @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands" @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" @rm tests/Xumemc.pid PHONY += clients clients: - @MEMC_BINARY@ -d -P tests/Xumemc.pid -p 12555 + @MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555 export MEMCACHED_SERVERS="localhost:12555" sh tests/t/memcat.test > tests/r/memcat.cmp diff tests/r/memcat.res tests/r/memcat.cmp @@ -102,9 +119,31 @@ clients: cat tests/Xumemc.pid | xargs kill rm tests/Xumemc.pid +MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE) + +HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE) + +test-mem: + $(MEM_COMMAND) + +test-hash: + $(HASH_COMMAND) + +gdb-mem: + $(DEBUG_COMMAND) $(MEM_COMMAND) + +gdb-hash: + $(DEBUG_COMMAND) $(HASH_COMMAND) + +valgrind-mem: + $(VALGRIND_COMMAND) $(MEM_COMMAND) + +valgrind-hash: + $(VALGRIND_COMMAND) $(HASH_COMMAND) + + PHONY += valgrind -valgrind: - $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/testapp +valgrind: tests/testapp tests/testhashkit valgrind-mem valgrind-hash PHONY += cachegrind CLEANFILES += tests/cachegrind.out