X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Finclude.am;h=e254670979273aba36d3c3434b43f3de2aadb775;hb=26f4a2a69a448fbda346b7bec93b6bd1d825e12b;hp=259da130cfd70f9d475ab0aae161e55c98d7bcbc;hpb=c67da677fe0944d3d2d3ff46e65fc3bc775404ae;p=m6w6%2Flibmemcached diff --git a/tests/include.am b/tests/include.am index 259da130..8063be75 100644 --- a/tests/include.am +++ b/tests/include.am @@ -1,175 +1,177 @@ # vim:ft=automake +# Copyright (C) 2011 Data Differential +# All rights reserved. +# +# Use and distribution licensed under the BSD license. See +# the COPYING file in the parent directory for full text. +# # included from Top Level Makefile.am # All paths should be given relative to the root -TESTS_LDADDS = libmemcached/libmemcached.la - -VALGRIND_COMMAND= $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes +TESTS_LDADDS= +TESTS_LDADDS+= libmemcached/libmemcached.la +TESTS_LDADDS+= libmemcached/libmemcachedutil.la +TESTS_LDADDS+= libtest/libtest.la 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 - -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 - -noinst_PROGRAMS+= \ - tests/atomsmasher \ - tests/startservers \ - tests/testapp \ - tests/testhashkit \ - tests/testplus \ - tests/udptest - -noinst_LTLIBRARIES+= tests/libserver.la -tests_libserver_la_SOURCES= tests/server.c - -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/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= \ - clients/libgenexec.la \ - 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 - sh tests/t/memcp.test > tests/r/memcp.res - sh tests/t/memrm.test > tests/r/memrm.res - sh tests/t/memslap.test > tests/r/memslap.res - sh tests/t/memstat.test > tests/r/memstat.res - -test: test-docs tests/testplus library_test memcapable libmhashkit_test - echo "Tests completed" - -library_test: tests/testapp - tests/testapp - -libmhashkit_test: libhashkit - tests/testhashkit - -memcapable: clients/memcapable - @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 `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 - sh tests/t/memcp.test > tests/r/memcp.cmp - diff tests/r/memcp.res tests/r/memcp.cmp - sh tests/t/memrm.test > tests/r/memrm.cmp - diff tests/r/memrm.res tests/r/memrm.cmp - sh tests/t/memslap.test > tests/r/memslap.cmp - diff tests/r/memslap.res tests/r/memslap.cmp - sh tests/t/memstat.test > tests/r/memstat.cmp - diff tests/r/memstat.res tests/r/memstat.cmp - 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: tests/testapp tests/testhashkit valgrind-mem valgrind-hash - -PHONY += cachegrind -CLEANFILES += tests/cachegrind.out -cachegrind: - rm -f tests/cachegrind.out.* - $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp - cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out - -PHONY += callgrind -CLEANFILES += tests/callgrind.out -callgrind: - rm -f tests/callgrind.out.* - $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp - callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out - -PHONY += helgrind -CLEANFILES+= helgrind.out.* -helgrind: - rm -f helgrind.out.* - $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp - -PHONY += helgrind-slap -helgrind-slap: - $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30 - -test-no-outputdiff: test - -hudson-valgrind: - $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp +PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole + +EXTRA_DIST+= tests/cpp_example.cc + +noinst_HEADERS+= tests/exist.h +noinst_HEADERS+= tests/hash_results.h +noinst_HEADERS+= tests/keys.hpp +noinst_HEADERS+= tests/libmemcached_test_container.h +noinst_HEADERS+= tests/libmemcached_world.h +noinst_HEADERS+= tests/libmemcached_world_socket.h +noinst_HEADERS+= tests/memc.h +noinst_HEADERS+= tests/runner.h + +# Cycle should always run first +tests_cycle_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING) +tests_cycle_CXXFLAGS= $(AM_CXXFLAGS) +tests_cycle_CXXFLAGS+= ${PTHREAD_CFLAGS} +tests_cycle_SOURCES= tests/cycle.cc +tests_cycle_DEPENDENCIES= $(TESTS_LDADDS) +tests_cycle_LDADD= $(tests_cycle_DEPENDENCIES) +tests_cycle_LDADD+= ${PTHREAD_LIBS} +check_PROGRAMS+= tests/cycle +noinst_PROGRAMS+= tests/cycle + +include tests/libmemcached-1.0/include.am + +include tests/parser.am + +tests_failure_SOURCES= +tests_failure_SOURCES+= tests/failure.cc +tests_failure_SOURCES+= clients/execute.cc +tests_failure_SOURCES+= clients/generator.cc +tests_failure_SOURCES+= tests/libmemcached-1.0/callback_counter.cc +tests_failure_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc +tests_failure_SOURCES+= tests/libmemcached-1.0/generate.cc +tests_failure_SOURCES+= tests/libmemcached-1.0/print.cc + +tests_failure_CXXFLAGS = $(AM_CXXFLAGS) +tests_failure_DEPENDENCIES= $(TESTS_LDADDS) +tests_failure_LDADD= $(tests_failure_DEPENDENCIES) +check_PROGRAMS+= tests/failure +noinst_PROGRAMS+= tests/failure + +test-failure: tests/failure + @tests/failure + +gdb-failure: tests/failure + @$(DEBUG_COMMAND) tests/failure + + +tests_testhashkit_SOURCES= tests/hashkit_functions.cc +tests_testhashkit_DEPENDENCIES= libtest/libtest.la libhashkit/libhashkit.la $(TESTS_LDADDS) +tests_testhashkit_LDADD= $(tests_testhashkit_DEPENDENCIES) +check_PROGRAMS+= tests/testhashkit +noinst_PROGRAMS+= tests/testhashkit + +test-hash: tests/testhashkit + @tests/testhashkit + + +tests_hash_plus_SOURCES= tests/hash_plus.cc +tests_hash_plus_CXXFLAGS= $(AM_CXXFLAGS) $(NO_EFF_CXX) +tests_hash_plus_DEPENDENCIES= $(tests_testhashkit_DEPENDENCIES) +tests_hash_plus_LDADD= $(tests_testhashkit_DEPENDENCIES) +check_PROGRAMS+= tests/hash_plus +noinst_PROGRAMS+= tests/hash_plus + +include tests/cli.am + +test: check + +check-local: $(TEST_DOCS) + @echo "Tests completed" + +test-mem: tests/libmemcached-1.0/testapp + @tests/libmemcached-1.0/testapp + +test-sasl: tests/sasl + @tests/sasl + +test-atom: tests/atomsmasher + @tests/atomsmasher + +test-plus: tests/testplus + @tests/testplus + +test-hashplus: tests/hash_plus + @tests/hash_plus + +test-cycle: tests/cycle + @tests/cycle + +test-memcapable: tests/memcapable + @tests/memcapable + +pahole-mem: tests/testapp + @$(PAHOLE_COMMAND) tests/testapp + +gdb-mem: tests/libmemcached-1.0/testapp + @$(DEBUG_COMMAND) tests/libmemcached-1.0/testapp + +gdb-sasl: tests/sasl + @$(DEBUG_COMMAND) tests/sasl + +gdb-atom: tests/atomsmasher + @$(DEBUG_COMMAND) tests/atomsmasher + +gdb-plus: tests/testplus + $(DEBUG_COMMAND) tests/testplus + +gdb-hash: tests/testhashkit + @$(DEBUG_COMMAND) tests/testhashkit + +gdb-hashplus: tests/hash_plus + @$(DEBUG_COMMAND) tests/hash_plus + +gdb-cycle: tests/cycle + @$(DEBUG_COMMAND) tests/cycle + +valgrind-cycle: tests/cycle + $(VALGRIND_COMMAND) tests/cycle + +valgrind-mem: tests/libmemcached-1.0/testapp + @$(VALGRIND_COMMAND) tests/libmemcached-1.0/testapp + +valgrind-failure: tests/failure + @$(VALGRIND_COMMAND) tests/failure + +valgrind-atom: tests/atomsmasher + $(VALGRIND_COMMAND) tests/atomsmasher + +valgrind-plus: tests/testplus + @$(VALGRIND_COMMAND) tests/testplus + +valgrind-sasl: tests/sasl + @$(VALGRIND_COMMAND) tests/sasl + +valgrind-hash: tests/testhashkit + @$(VALGRIND_COMMAND) tests/testhashkit + +valgrind-hashplus: tests/hash_plus + @$(VALGRIND_COMMAND) tests/hash_plus + +helgrind-cycle: tests/cycle + @$(HELGRIND_COMMAND) tests/cycle + +helgrind-mem: tests/libmemcached-1.0/testapp + @$(HELGRIND_COMMAND) tests/libmemcached-1.0/testapp + +helgrind-atom: tests/atomsmasher + @$(HELGRIND_COMMAND) tests/atomsmasher + +helgrind-plus: tests/testplus + @$(HELGRIND_COMMAND) tests/testplus + +helgrind-hash: tests/testhashkit + @$(HELGRIND_COMMAND) tests/testhashkit + +helgrind-hashplus: tests/hash_plus + @$(HELGRIND_COMMAND) tests/hash_plus