-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/hashplus \
- tests/memplus \
- tests/startservers \
- tests/testapp \
- tests/testhashkit \
- tests/testplus
-
-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_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)
-
-tests_hashplus_SOURCES = tests/hash_plus.cc
-tests_hashplus_LDADD = $(tests_testhashkit_LDADD)
-tests_hashplus_DEPENDENCIES = $(tests_testhashkit_LDADD)
-
-tests_memplus_SOURCES = tests/mem_plus.cc
-tests_memplus_LDADD = tests/libtest.la tests/libserver.la libmemcached/libmemcached.la
-tests_memplus_DEPENDENCIES = $(tests_memplus_LDADD)
-
-test: test-docs test-mem test-hash memcapable
- echo "Tests completed"
-
-test-x: test-docs test-plus test-mem test-hash memcapable test-memcat test-memcp test-memrm test-memerror test-memdump test-memflush test-memstat
- echo "Tests completed"
-
-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
-
-test-memcat: clients/memcat clients/memcp
- @echo "Testing memcat"
- @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memcp --servers="localhost:12555" clients/memcp
- @clients/memcat --servers="localhost:12555" memcp > tests/scratch
-# @diff clients/memcp tests/scratch
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
- @rm tests/scratch
-
-valgrind-memcat: clients/memcat clients/memcp
- @echo "Testing memcat"
- @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memcp --servers="localhost:12555" clients/memcp
- @$(VALGRIND_COMMAND) clients/memcat --servers="localhost:12555" memcp > tests/scratch
-# @diff clients/memcp tests/scratch
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
- @rm tests/scratch
-
-test-memcp: clients/memcp
- @echo "Testing memcp"
- @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-valgrind-memcp: clients/memcat clients/memcp
- @echo "Testing memcp"
- @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
- @$(VALGRIND_COMMAND) clients/memcp --servers="localhost:12555" clients/memcp clients/memcat clients/memstat
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-test-memrm: clients/memrm clients/memcp
- @echo "Testing memrm"
- @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memcp --servers="localhost:12555" clients/memcat
- @clients/memrm --servers="localhost:12555" memcat
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-valgrind-memrm: clients/memcat clients/memcp
- @echo "Testing memrm"
- @@MEMC_BINARY@ -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memcp --servers="localhost:12555" clients/memcat
- @$(VALGRIND_COMMAND) clients/memrm --servers="localhost:12555" memcat
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-test-memflush: clients/memflush
- @echo "Testing memflush"
- @/usr/local/bin/memcached -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memflush --servers="localhost:12555"
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-valgrind-memflush: clients/memflush
- @echo "Testing memflush"
- @/usr/local/bin/memcached -d -P `pwd`/tests/Xumemc.pid -p 12555
- @$(VALGRIND_COMMAND) clients/memflush --servers="localhost:12555"
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-test-memdump: clients/memdump clients/memcp
- @echo "Testing memdump"
- @/usr/local/bin/memcached -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memcp --servers="localhost:12555" clients/memcat
- @clients/memdump --servers="localhost:12555" > /dev/null
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-valgrind-memdump: clients/memcat clients/memcp
- @echo "Testing memdump"
- @/usr/local/bin/memcached -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memcp --servers="localhost:12555" clients/memcat
- @$(VALGRIND_COMMAND) clients/memdump --servers="localhost:12555" > /dev/null
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-test-memstat: clients/memstat
- @echo "Testing memstat"
- @/usr/local/bin/memcached -d -P `pwd`/tests/Xumemc.pid -p 12555
- @clients/memstat --servers="localhost:12555" > /dev/null
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-valgrind-memstat: clients/memstat
- @echo "Testing memstat"
- @/usr/local/bin/memcached -d -P `pwd`/tests/Xumemc.pid -p 12555
- @$(VALGRIND_COMMAND) clients/memstat --servers="localhost:12555" > /dev/null
- @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server"
- @rm tests/Xumemc.pid
-
-test-memerror: clients/memerror
- @echo "Testing memerror"
- @clients/memerror 0 > /dev/null
-
-valgrind-memerror: clients/memerror
- @echo "Testing memerror"
- @$(VALGRIND_COMMAND) clients/memerror 0 > /dev/null
-
-
-
-
-
-MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE)
-
-MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE)
-
-TESTPLUS_COMMAND= tests/testplus $(COLLECTION) $(SUITE)
-
-MEMPLUS_COMMAND= tests/memplus $(COLLECTION) $(SUITE)
-
-HASHPLUS_COMMAND= tests/hashplus $(COLLECTION) $(SUITE)
-
-ATOM_COMMAND= tests/atomsmasher $(COLLECTION) $(SUITE)
-
-HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE)
-
-test-mem: tests/testapp
- $(MEM_COMMAND)
+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
+
+test-mem: tests/libmemcached-1.0/testapp
+ @tests/libmemcached-1.0/testapp