-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
-
-MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE)
-
-MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
-
-HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
-
-test-mem: tests/testapp
- $(MEM_COMMAND)
+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
+
+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