void pairs_free(pairs_st *pairs)
{
if (pairs == NULL)
+ {
return;
+ }
/* We free until we hit the null pair we stores during creation */
for (uint32_t x= 0; pairs[x].key; x++)
AM_CONDITIONAL(BUILDING_LIBMEMCACHED, true)
AM_CONDITIONAL(HAVE_LIBMEMCACHED, false)
+AM_CONDITIONAL(HAVE_LIBDRIZZLE, false)
AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enables libmemcached Support])
AM_CONDITIONAL(BUILDING_GEARMAN, false)
AC_DEFINE([HAVE_LIBDRIZZLE], [0], [Support for libdrizzle])
AC_DEFINE([HAVE_DRIZZLED_BINARY], [0], [Support for DrizzleD])
+AC_DEFINE([DRIZZLED_BINARY], [0], [Support for DrizzleD])
AC_DEFINE([GEARMAND_BLOBSLAP_WORKER], [0], [Support for Gearman Blobslap worker])
AC_DEFINE([HAVE_LIBPQ], [0], [Support for Postgres])
AC_DEFINE([HAVE_LIBCURL], [0], [Support for libcurl])
-.TH "HASHKIT_CLONE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_CLONE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_clone \- libhashkit Documentation
.
-.TH "HASHKIT_CRC32" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_CRC32" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_crc32 \- libhashkit Documentation
.
-.TH "HASHKIT_CREATE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_CREATE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_create \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1_32" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1_32" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1_32 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1_64" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1_64" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1_64 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1A_32" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1A_32" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1a_32 \- libhashkit Documentation
.
-.TH "HASHKIT_FNV1A_64" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FNV1A_64" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_fnv1a_64 \- libhashkit Documentation
.
-.TH "HASHKIT_FREE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FREE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_free \- libhashkit Documentation
.
-.TH "HASHKIT_FUNCTIONS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_FUNCTIONS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_functions \- libhashkit Documentation
.
-.TH "HASHKIT_HSIEH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_HSIEH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_hsieh \- libhashkit Documentation
.
-.TH "HASHKIT_IS_ALLOCATED" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_IS_ALLOCATED" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_is_allocated \- libhashkit Documentation
.
-.TH "HASHKIT_JENKINS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_JENKINS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_jenkins \- libhashkit Documentation
.
-.TH "HASHKIT_MD5" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_MD5" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_md5 \- libhashkit Documentation
.
-.TH "HASHKIT_MURMUR" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_MURMUR" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_murmur \- libhashkit Documentation
.
-.TH "HASHKIT_VALUE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "HASHKIT_VALUE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
hashkit_value \- libhashkit Documentation
.
-.TH "LIBHASHKIT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "LIBHASHKIT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
libhashkit \- libhashkit Documentation
.
-.TH "LIBMEMCACHED" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached \- Introducing the C Client Library for memcached
.
-.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED_CHECK_CONFIGURATION" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached_check_configuration \- libmemcached Documentation
.
-.TH "LIBMEMCACHED_CONFIGURATION" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED_CONFIGURATION" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached_configuration \- libmemcached Documentation
.
-.TH "LIBMEMCACHED_EXAMPLES" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHED_EXAMPLES" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcached_examples \- libmemcached Documentation
.
-.TH "LIBMEMCACHEDUTIL" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "LIBMEMCACHEDUTIL" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
libmemcachedutil \- libmemcached Documentation
.
-.TH "MEMASLAP" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMASLAP" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memaslap \- libmemcached Documentation
.
-.TH "MEMCACHED" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached \- libmemcached Documentation
.
-.TH "MEMCACHED_ADD" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_ADD" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_add \- Storing and Replacing Data
.
-.TH "MEMCACHED_ADD_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_ADD_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_add_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_ANALYZE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_ANALYZE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_analyze \- libmemcached Documentation
.
-.TH "MEMCACHED_APPEND" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_APPEND" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_append \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_APPEND_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_APPEND_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_append_by_key \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_AUTO" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_AUTO" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_auto \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_BEHAVIOR" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_behavior \- libmemcached Documentation
.
-.TH "MEMCACHED_BEHAVIOR_GET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_GET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_behavior_get \- libmemcached Documentation
.
-.TH "MEMCACHED_BEHAVIOR_SET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_BEHAVIOR_SET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_behavior_set \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CALLBACK" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_callback \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK_GET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CALLBACK_GET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_callback_get \- libmemcached Documentation
.
-.TH "MEMCACHED_CALLBACK_SET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CALLBACK_SET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_callback_set \- libmemcached Documentation
.
-.TH "MEMCACHED_CAS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CAS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_cas \- Working with data on the server in an atomic fashion
.
-.TH "MEMCACHED_CAS_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CAS_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_cas_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_CLONE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CLONE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_clone \- libmemcached Documentation
.
-.TH "MEMCACHED_CREATE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_CREATE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_create \- libmemcached Documentation
.
-.TH "MEMCACHED_DECREMENT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DECREMENT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_decrement \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DECREMENT_WITH_INITIAL" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_decrement_with_initial \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_DELETE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DELETE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_delete \- libmemcached Documentation
.
-.TH "MEMCACHED_DELETE_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DELETE_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_delete_by_key \- libmemcached Documentation
.
-.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DESTROY_SASL_AUTH_DATA" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_destroy_sasl_auth_data \- libmemcached Documentation
.
-.TH "MEMCACHED_DUMP" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_DUMP" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_dump \- libmemcached Documentation
.
-.TH "MEMCACHED_EXIST" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_EXIST" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_exist \- libmemcached Documentation
.
-.TH "MEMCACHED_EXIST_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_EXIST_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_exist_by_key \- libmemcached Documentation
.
-.TH "MEMCACHED_FETCH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FETCH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_fetch \- Retrieving data from the server
.
-.TH "MEMCACHED_FETCH_EXECUTE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FETCH_EXECUTE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_fetch_execute \- Retrieving data from the server
.
-.TH "MEMCACHED_FETCH_RESULT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FETCH_RESULT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_fetch_result \- Retrieving data from the server
.
-.TH "MEMCACHED_FLUSH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FLUSH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_flush \- libmemcached Documentation
.
-.TH "MEMCACHED_FLUSH_BUFFERS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FLUSH_BUFFERS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_flush_buffers \- libmemcached Documentation
.
-.TH "MEMCACHED_FREE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_FREE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_free \- libmemcached Documentation
.
-.TH "MEMCACHED_GENERATE_HASH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_generate_hash \- Generating hash values directly
.
-.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GENERATE_HASH_VALUE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_generate_hash_value \- Generating hash values directly
.
-.TH "MEMCACHED_GET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get \- Retrieving data from the server
.
-.TH "MEMCACHED_GET_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_MEMORY_ALLOCATORS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_SASL_CALLBACKS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_sasl_callbacks \- libmemcached Documentation
.
-.TH "MEMCACHED_GET_USER_DATA" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_GET_USER_DATA" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_get_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_INCREMENT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_INCREMENT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_increment \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_INCREMENT_WITH_INITIAL" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_increment_with_initial \- Incrementing and Decrementing Values
.
-.TH "MEMCACHED_LAST_ERROR_MESSAGE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_LAST_ERROR_MESSAGE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_last_error_message \- libmemcached Documentation
.
-.TH "MEMCACHED_LIB_VERSION" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_LIB_VERSION" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_lib_version \- libmemcached Documentation
.
-.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MEMORY_ALLOCATORS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_MGET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_EXECUTE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget_execute \- Retrieving data from the server
.
-.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_MGET_EXECUTE_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_mget_execute_by_key \- Retrieving data from the server
.
-.TH "MEMCACHED_POOL" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_GET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_behavior_get \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_BEHAVIOR_SET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_behavior_set \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_CREATE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_CREATE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_create \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_DESTROY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_DESTROY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_destroy \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_FETCH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_FETCH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_fetch \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_POP" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_POP" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_pop \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_PUSH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_PUSH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_push \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_RELEASE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_RELEASE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_release \- libmemcached Documentation
.
-.TH "MEMCACHED_POOL_ST" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_POOL_ST" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_pool_st \- libmemcached Documentation
.
-.TH "MEMCACHED_PREPEND" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_PREPEND" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_prepend \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_PREPEND_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_PREPEND_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_prepend_by_key \- Appending to or Prepending to data on the server
.
-.TH "MEMCACHED_QUIT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_QUIT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_quit \- libmemcached Documentation
.
-.TH "MEMCACHED_REPLACE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_REPLACE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_replace \- Storing and Replacing Data
.
-.TH "MEMCACHED_REPLACE_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_REPLACE_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_replace_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_RESULT_CAS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_CAS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_cas \- Working with result sets
.
-.TH "MEMCACHED_RESULT_CREATE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_CREATE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_create \- Working with result sets
.
-.TH "MEMCACHED_RESULT_FLAGS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_FLAGS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_flags \- Working with result sets
.
-.TH "MEMCACHED_RESULT_FREE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_FREE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_free \- Working with result sets
.
-.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_LENGTH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_key_length \- Working with result sets
.
-.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_KEY_VALUE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_key_value \- Working with result sets
.
-.TH "MEMCACHED_RESULT_LENGTH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_LENGTH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_length \- Working with result sets
.
-.TH "MEMCACHED_RESULT_ST" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_ST" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_st \- Working with result sets
.
-.TH "MEMCACHED_RESULT_VALUE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RESULT_VALUE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_result_value \- Working with result sets
.
-.TH "MEMCACHED_RETURN_T" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_RETURN_T" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_return_t \- Return type values
.
-.TH "MEMCACHED_SASL" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SASL" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_sasl \- libmemcached Documentation
.
-.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SASL_SET_AUTH_DATA" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_sasl_set_auth_data \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ADD" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_add \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_ADD_UNIX_SOCKET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_add_unix_socket \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_COUNT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_COUNT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_count \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_CURSOR" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_CURSOR" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_cursor \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_APPEND" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list_append \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_COUNT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list_count \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_LIST_FREE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_LIST_FREE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_list_free \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_PUSH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_PUSH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_push \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVER_ST" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVER_ST" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_server_st \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVERS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_servers \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS_PARSE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVERS_PARSE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_servers_parse \- libmemcached Documentation
.
-.TH "MEMCACHED_SERVERS_RESET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SERVERS_RESET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_servers_reset \- libmemcached Documentation
.
-.TH "MEMCACHED_SET" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set \- Storing and Replacing Data
.
-.TH "MEMCACHED_SET_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_by_key \- Storing and Replacing Data
.
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_memory_allocators \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_MEMORY_ALLOCATORS_CONTEXT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_memory_allocators_context \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_SASL_CALLBACKS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_sasl_callbacks \- libmemcached Documentation
.
-.TH "MEMCACHED_SET_USER_DATA" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_SET_USER_DATA" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_set_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_EXECUTE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_EXECUTE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_execute \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_GET_KEYS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_GET_KEYS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_get_keys \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_GET_VALUE" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_GET_VALUE" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_get_value \- libmemcached Documentation
.
-.TH "MEMCACHED_STAT_SERVERNAME" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STAT_SERVERNAME" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stat_servername \- libmemcached Documentation
.
-.TH "MEMCACHED_STATS" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STATS" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_stats \- libmemcached Documentation
.
-.TH "MEMCACHED_STRERROR" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_STRERROR" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_strerror \- libmemcached Documentation
.
-.TH "MEMCACHED_TOUCH" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_TOUCH" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_touch \- libmemcached Documentation
.
-.TH "MEMCACHED_TOUCH_BY_KEY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_TOUCH_BY_KEY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_touch_by_key \- libmemcached Documentation
.
-.TH "MEMCACHED_USER_DATA" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_USER_DATA" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_user_data \- libmemcached Documentation
.
-.TH "MEMCACHED_VERBOSITY" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_VERBOSITY" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_verbosity \- libmemcached Documentation
.
-.TH "MEMCACHED_VERSION" "3" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCACHED_VERSION" "3" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcached_version \- libmemcached Documentation
.
-.TH "MEMCAPABLE" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCAPABLE" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcapable \- libmemcached Documentation
.
-.TH "MEMCAT" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCAT" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcat \- libmemcached Documentation
.
-.TH "MEMCP" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMCP" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memcp \- libmemcached Documentation
.
-.TH "MEMDUMP" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMDUMP" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memdump \- libmemcached Documentation
.
-.TH "MEMERROR" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMERROR" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memerror \- libmemcached Documentation
.
-.TH "MEMFLUSH" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMFLUSH" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memflush \- libmemcached Documentation
.
-.TH "MEMRM" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMRM" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memrm \- libmemcached Documentation
.
-.TH "MEMSLAP" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMSLAP" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memslap \- libmemcached Documentation
.
-.TH "MEMSTAT" "1" "April 09, 2012" "1.0.6" "libmemcached"
+.TH "MEMSTAT" "1" "April 17, 2012" "1.0.6" "libmemcached"
.SH NAME
memstat \- libmemcached Documentation
.
}
};
-static MemcachedLightRunner defualt_libmemcached_runner;
-
test_st cmdline_option_TESTS[] ={
{"--help", true, help_TEST },
{"--verbose", true, verbose_TEST },
world->_create= world_create;
world->_destroy= world_destroy;
world->collections= collection;
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new MemcachedLightRunner);
}
if (ptr->root->poll_timeout == 0) // Mimic 0 causes timeout behavior (not all platforms do this)
{
+ ptr->io_wait_count.timeouts++;
return memcached_set_error(*ptr, MEMCACHED_TIMEOUT, MEMCACHED_AT);
}
+ int local_errno;
size_t loop_max= 5;
while (--loop_max) // While loop is for ERESTART or EINTR
{
int active_fd= poll(&fds, 1, ptr->root->poll_timeout);
- assert_msg(active_fd <= 1 , "poll() returned an unexpected value");
- if (active_fd == 1)
+ if (active_fd >= 1)
{
+ assert_msg(active_fd == 1 , "poll() returned an unexpected value");
return MEMCACHED_SUCCESS;
}
else if (active_fd == 0)
ptr->io_wait_count.timeouts++;
return memcached_set_error(*ptr, MEMCACHED_TIMEOUT, MEMCACHED_AT);
}
- else // -1
+
+ // Only an error should result in this code being called.
+ local_errno= get_socket_errno(); // We cache in case memcached_quit_server() modifies errno
+ assert_msg(active_fd == -1 , "poll() returned an unexpected value");
+ switch (local_errno)
{
- switch (get_socket_errno())
- {
#ifdef TARGET_OS_LINUX
- case ERESTART:
+ case ERESTART:
#endif
- case EINTR:
- break;
+ case EINTR:
+ continue;
- case EFAULT:
- case ENOMEM:
- return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
+ case EFAULT:
+ case ENOMEM:
+ return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT);
- case EINVAL:
- return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, memcached_literal_param("RLIMIT_NOFILE exceeded, or if OSX the timeout value was invalid"));
+ case EINVAL:
+ return memcached_set_error(*ptr, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_AT, memcached_literal_param("RLIMIT_NOFILE exceeded, or if OSX the timeout value was invalid"));
- default:
- int local_errno= get_socket_errno(); // We cache in case memcached_quit_server() modifies errno
- if (fds.revents & POLLERR)
+ default:
+ if (fds.revents & POLLERR)
+ {
+ int err;
+ socklen_t len= sizeof (err);
+ if (getsockopt(ptr->fd, SOL_SOCKET, SO_ERROR, &err, &len) == 0)
{
- int err;
- socklen_t len= sizeof (err);
- if (getsockopt(ptr->fd, SOL_SOCKET, SO_ERROR, &err, &len) == 0)
+ if (err == 0) // treat this as EINTR
{
- if (err == 0) // treat this as EINTR
- {
- continue;
- }
- local_errno= err;
+ continue;
}
+ local_errno= err;
}
- memcached_quit_server(ptr, true);
-
- return memcached_set_errno(*ptr, local_errno, MEMCACHED_AT);
}
+ break;
}
+
+ break; // should only occur from poll error
}
memcached_quit_server(ptr, true);
- return memcached_set_errno(*ptr, get_socket_errno(), MEMCACHED_AT);
+ return memcached_set_errno(*ptr, local_errno, MEMCACHED_AT);
}
static bool io_flush(memcached_server_write_instance_st ptr,
WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
WATCHPOINT_ASSERT(write_length > 0);
- ssize_t sent_length= 0;
- WATCHPOINT_ASSERT(ptr->fd != INVALID_SOCKET);
- if (with_flush)
- {
- sent_length= ::send(ptr->fd, local_write_ptr, write_length, MSG_NOSIGNAL|MSG_DONTWAIT);
- }
- else
- {
- sent_length= ::send(ptr->fd, local_write_ptr, write_length, MSG_NOSIGNAL|MSG_DONTWAIT|MSG_MORE);
- }
+ int flags= with_flush ? MSG_NOSIGNAL|MSG_DONTWAIT : MSG_NOSIGNAL|MSG_DONTWAIT|MSG_MORE;
+ ssize_t sent_length= ::send(ptr->fd, local_write_ptr, write_length, flags);
if (sent_length == SOCKET_ERROR)
{
}
else if (rc == MEMCACHED_TIMEOUT)
{
- ptr->io_wait_count.timeouts++;
- error= memcached_set_error(*ptr, MEMCACHED_TIMEOUT, MEMCACHED_AT);
return false;
}
return false;
}
+bool has_drizzled_binary()
+{
+#if defined(HAVE_DRIZZLED_BINARY) && HAVE_DRIZZLED_BINARY
+ if (access(DRIZZLED_BINARY, R_OK|X_OK) == 0)
+ {
+ return true;
+ }
+#endif
+
+ return false;
+}
+
bool has_memcached_binary()
{
#if defined(HAVE_MEMCACHED_BINARY) && HAVE_MEMCACHED_BINARY
- if (access(MEMCACHED_BINARY,R_OK|X_OK) == 0)
+ if (access(MEMCACHED_BINARY, R_OK|X_OK) == 0)
{
return true;
}
LIBTEST_API
bool has_gearmand_binary();
+LIBTEST_API
+bool has_drizzled_binary();
+
} // namespace libtest
_use_valgrind(false),
_use_gdb(false),
_use_ptrcheck(false),
+ _will_fail(false),
_argc(0),
_exectuble(arg),
stdin_fd(STDIN_FILENO),
if (spawn_ret != 0)
{
- Error << strerror(spawn_ret) << "(" << spawn_ret << ")";
+ if (_will_fail == false)
+ {
+ Error << strerror(spawn_ret) << "(" << spawn_ret << ")";
+ }
_pid= -1;
return Application::INVALID;
}
return GEARMAND_BINARY;
}
+const char *drizzled_binary()
+{
+ return DRIZZLED_BINARY;
+}
+
} // namespace exec_cmdline
return _pid;
}
+ void will_fail()
+ {
+ _will_fail= true;
+ }
+
private:
void create_argv(const char *args[]);
void delete_argv();
bool _use_valgrind;
bool _use_gdb;
bool _use_ptrcheck;
+ bool _will_fail;
size_t _argc;
std::string _exectuble_name;
std::string _exectuble;
int exec_cmdline(const std::string& executable, const char *args[], bool use_libtool= false);
const char *gearmand_binary();
+const char *drizzled_binary();
}
#include <libtest/gearmand.h>
#include <libtest/blobslap_worker.h>
#include <libtest/memcached.h>
+#include <libtest/drizzled.h>
#include <libtest/libtool.hpp>
#include <libtest/killpid.h>
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * libtest
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <config.h>
+#include <libtest/common.h>
+
+#include <libtest/drizzled.h>
+
+#include "util/instance.hpp"
+#include "util/operation.hpp"
+
+using namespace datadifferential;
+using namespace libtest;
+
+#include <cassert>
+#include <cerrno>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <signal.h>
+#include <sstream>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+#ifndef __INTEL_COMPILER
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+#endif
+
+#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
+#include <libdrizzle-1.0/drizzle_client.h>
+#endif
+
+using namespace libtest;
+
+namespace libtest {
+bool ping_drizzled(const in_port_t _port)
+{
+#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
+ {
+ drizzle_st *drizzle= drizzle_create(NULL);
+
+ if (drizzle == NULL)
+ {
+ return false;
+ }
+
+ drizzle_con_st *con;
+
+ if ((con= drizzle_con_create(drizzle, NULL)) == NULL)
+ {
+ drizzle_free(drizzle);
+ return false;
+ }
+
+ drizzle_con_set_tcp(con, "localhost", _port);
+ drizzle_con_set_auth(con, "root", 0);
+
+ bool success= false;
+
+ drizzle_return_t rc;
+ if ((rc= drizzle_con_connect(con)) == DRIZZLE_RETURN_OK)
+ {
+ drizzle_result_st *result= drizzle_ping(con, NULL, &rc);
+ success= bool(result);
+ drizzle_result_free(result);
+ }
+
+ if (success == true)
+ { }
+ else if (rc != DRIZZLE_RETURN_OK)
+ {
+ Error << drizzle_error(drizzle) << " localhost:" << _port;
+ }
+
+ drizzle_con_free(con);
+ drizzle_free(drizzle);
+
+ return success;
+ }
+#endif
+
+ return false;
+}
+} // namespace libtest
+
+class Drizzle : public libtest::Server
+{
+private:
+public:
+ Drizzle(const std::string& host_arg, in_port_t port_arg) :
+ libtest::Server(host_arg, port_arg, DRIZZLED_BINARY, false)
+ {
+ set_pid_file();
+ }
+
+ bool ping()
+ {
+ size_t limit= 5;
+ while (_app.check() and --limit)
+ {
+ if (ping_drizzled(_port))
+ {
+ return true;
+ }
+ libtest::dream(1, 0);
+ }
+
+ return false;
+ }
+
+ const char *name()
+ {
+ return "drizzled";
+ };
+
+ void log_file_option(Application& app, const std::string& arg)
+ {
+ }
+
+ bool has_log_file_option() const
+ {
+ return true;
+ }
+
+ bool broken_pid_file()
+ {
+ return true;
+ }
+
+ bool is_libtool()
+ {
+ return false;
+ }
+
+ bool has_syslog() const
+ {
+ return true;
+ }
+
+ bool has_port_option() const
+ {
+ return true;
+ }
+
+ void port_option(Application& app, in_port_t arg)
+ {
+ if (arg > 0)
+ {
+ char buffer[1024];
+ snprintf(buffer, sizeof(buffer), "--drizzle-protocol.port=%d", int(arg));
+ app.add_option(buffer);
+ }
+ }
+
+ bool build(size_t argc, const char *argv[]);
+};
+
+bool Drizzle::build(size_t argc, const char *argv[])
+{
+ if (getuid() == 0 or geteuid() == 0)
+ {
+ add_option("--user=root");
+ }
+
+ add_option("--verbose=INSPECT");
+#if 0
+ add_option("--datadir=var/drizzle");
+#endif
+
+ for (size_t x= 0 ; x < argc ; x++)
+ {
+ add_option(argv[x]);
+ }
+
+ return true;
+}
+
+namespace libtest {
+
+libtest::Server *build_drizzled(const char *hostname, in_port_t try_port)
+{
+ return new Drizzle(hostname, try_port);
+}
+
+}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * libtest
+ *
+ * Copyright (C) 2012 Data Differential, http://datadifferential.com/
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#pragma once
+
+#include <arpa/inet.h>
+
+namespace libtest { struct Server; }
+
+namespace libtest {
+
+libtest::Server *build_drizzled(const char *hostname, in_port_t try_port);
+
+bool ping_drizzled(const in_port_t);
+
+}
+
return TEST_SUCCESS;
}
-static Runner defualt_runners;
-
Framework::Framework() :
collections(NULL),
_create(NULL),
}
_servers.shutdown();
+
+ delete _runner;
}
test_return_t Framework::Item::pre(void *arg)
{
if (_runner == NULL)
{
- _runner= &defualt_runners;
+ _runner= new Runner;
}
_runner->set_servers(_servers);
bool has_syslog() const
{
- return true;
+ return false; // --syslog.errmsg-enable
}
bool has_port_option() const
EXTRA_DIST+= libtest/run.gdb
CLEANFILES+= \
+ tmp_chroot/var/drizzle/* \
tmp_chroot/var/log/* \
tmp_chroot/var/run/* \
tmp_chroot/var/tmp/*
libtest/fatal.hpp \
libtest/framework.h \
libtest/gearmand.h \
+ libtest/drizzled.h \
libtest/get.h \
libtest/has.hpp \
libtest/http.hpp \
libtest/wait.h
noinst_LTLIBRARIES+= libtest/libtest.la
-libtest_libtest_la_SOURCES= \
- libtest/binaries.cc \
- libtest/cmdline.cc \
- libtest/comparison.cc \
- libtest/core.cc \
- libtest/cpu.cc \
- libtest/dream.cc \
- libtest/fatal.cc \
- libtest/framework.cc \
- libtest/has.cc \
- libtest/http.cc \
- libtest/is_local.cc \
- libtest/killpid.cc \
- libtest/libtool.cc \
- libtest/port.cc \
- libtest/runner.cc \
- libtest/server.cc \
- libtest/server_container.cc \
- libtest/signal.cc \
- libtest/socket.cc \
- libtest/strerror.cc \
- libtest/test.cc \
- libtest/tmpfile.cc \
- libtest/vchar.cc
libtest_libtest_la_CXXFLAGS=
libtest_libtest_la_DEPENDENCIES=
libtest_libtest_la_LIBADD=
+libtest_libtest_la_SOURCES=
+
+libtest_libtest_la_SOURCES+= libtest/binaries.cc
+libtest_libtest_la_SOURCES+= libtest/cmdline.cc
+libtest_libtest_la_SOURCES+= libtest/comparison.cc
+libtest_libtest_la_SOURCES+= libtest/core.cc
+libtest_libtest_la_SOURCES+= libtest/cpu.cc
+libtest_libtest_la_SOURCES+= libtest/dream.cc
+libtest_libtest_la_SOURCES+= libtest/fatal.cc
+libtest_libtest_la_SOURCES+= libtest/framework.cc
+libtest_libtest_la_SOURCES+= libtest/has.cc
+libtest_libtest_la_SOURCES+= libtest/drizzled.cc
+libtest_libtest_la_SOURCES+= libtest/http.cc
+libtest_libtest_la_SOURCES+= libtest/is_local.cc
+libtest_libtest_la_SOURCES+= libtest/killpid.cc
+libtest_libtest_la_SOURCES+= libtest/libtool.cc
+libtest_libtest_la_SOURCES+= libtest/main.cc
+libtest_libtest_la_SOURCES+= libtest/port.cc
+libtest_libtest_la_SOURCES+= libtest/runner.cc
+libtest_libtest_la_SOURCES+= libtest/server.cc
+libtest_libtest_la_SOURCES+= libtest/server_container.cc
+libtest_libtest_la_SOURCES+= libtest/signal.cc
+libtest_libtest_la_SOURCES+= libtest/socket.cc
+libtest_libtest_la_SOURCES+= libtest/strerror.cc
+libtest_libtest_la_SOURCES+= libtest/tmpfile.cc
+libtest_libtest_la_SOURCES+= libtest/vchar.cc
libtest_libtest_la_CXXFLAGS+= ${NO_CONVERSION}
libtest_libtest_la_CXXFLAGS+= -DBUILDING_LIBTEST
endif
endif
+if HAVE_LIBDRIZZLE
+
+libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS)
+libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS)
+
+endif
+
if BUILDING_GEARMAN
libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la
libtest_libtest_la_LIBADD+= libgearman/libgearman.la
endif
endif
-libtest_tmp_dir: tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run
+libtest_tmp_dir: tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
tmp_chroot:
@$(mkdir_p) tmp_chroot
tmp_chroot/var/tmp: tmp_chroot/var
@$(mkdir_p) tmp_chroot/var/tmp
+tmp_chroot/var/drizzle: tmp_chroot/var
+ @$(mkdir_p) tmp_chroot/var/drizzle
+
tmp_chroot/var/run: tmp_chroot/var
@$(mkdir_p) tmp_chroot/var/run
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * libtest
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <libtest/common.h>
+
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <ctime>
+#include <fnmatch.h>
+#include <iostream>
+
+#include <signal.h>
+
+#ifndef __INTEL_COMPILER
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+#endif
+
+using namespace libtest;
+
+static void stats_print(Stats *stats)
+{
+ if (stats->collection_failed == 0 and stats->collection_success == 0)
+ {
+ return;
+ }
+
+ Out << "\tTotal Collections\t\t\t\t" << stats->collection_total;
+ Out << "\tFailed Collections\t\t\t\t" << stats->collection_failed;
+ Out << "\tSkipped Collections\t\t\t\t" << stats->collection_skipped;
+ Out << "\tSucceeded Collections\t\t\t\t" << stats->collection_success;
+ Outn();
+ Out << "Total\t\t\t\t" << stats->total;
+ Out << "\tFailed\t\t\t" << stats->failed;
+ Out << "\tSkipped\t\t\t" << stats->skipped;
+ Out << "\tSucceeded\t\t" << stats->success;
+}
+
+static long int timedif(struct timeval a, struct timeval b)
+{
+ long us, s;
+
+ us = (long)(a.tv_usec - b.tv_usec);
+ us /= 1000;
+ s = (long)(a.tv_sec - b.tv_sec);
+ s *= 1000;
+ return s + us;
+}
+
+#include <getopt.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+ bool opt_massive= false;
+ unsigned long int opt_repeat= 1; // Run all tests once
+ bool opt_quiet= false;
+ std::string collection_to_run;
+
+ // Options parsing
+ {
+ enum long_option_t {
+ OPT_LIBYATL_VERSION,
+ OPT_LIBYATL_MATCH_COLLECTION,
+ OPT_LIBYATL_MASSIVE,
+ OPT_LIBYATL_QUIET,
+ OPT_LIBYATL_REPEAT
+ };
+
+ static struct option long_options[]=
+ {
+ { "version", no_argument, NULL, OPT_LIBYATL_VERSION },
+ { "quiet", no_argument, NULL, OPT_LIBYATL_QUIET },
+ { "repeat", no_argument, NULL, OPT_LIBYATL_REPEAT },
+ { "collection", required_argument, NULL, OPT_LIBYATL_MATCH_COLLECTION },
+ { "massive", no_argument, NULL, OPT_LIBYATL_MASSIVE },
+ { 0, 0, 0, 0 }
+ };
+
+ int option_index= 0;
+ while (1)
+ {
+ int option_rv= getopt_long(argc, argv, "", long_options, &option_index);
+ if (option_rv == -1)
+ {
+ break;
+ }
+
+ switch (option_rv)
+ {
+ case OPT_LIBYATL_VERSION:
+ break;
+
+ case OPT_LIBYATL_QUIET:
+ opt_quiet= true;
+ break;
+
+ case OPT_LIBYATL_REPEAT:
+ opt_repeat= strtoul(optarg, (char **) NULL, 10);
+ break;
+
+ case OPT_LIBYATL_MATCH_COLLECTION:
+ collection_to_run= optarg;
+ break;
+
+ case OPT_LIBYATL_MASSIVE:
+ opt_massive= true;
+ break;
+
+ case '?':
+ /* getopt_long already printed an error message. */
+ Error << "unknown option to getopt_long()";
+ exit(EXIT_FAILURE);
+
+ default:
+ break;
+ }
+ }
+ }
+
+ srandom((unsigned int)time(NULL));
+
+ if (bool(getenv("YATL_REPEAT")) and (strtoul(getenv("YATL_REPEAT"), (char **) NULL, 10) > 1))
+ {
+ opt_repeat= strtoul(getenv("YATL_REPEAT"), (char **) NULL, 10);
+ }
+
+ if ((bool(getenv("YATL_QUIET")) and (strcmp(getenv("YATL_QUIET"), "0") == 0)) or opt_quiet)
+ {
+ opt_quiet= true;
+ }
+ else if (getenv("JENKINS_URL"))
+ {
+ if (bool(getenv("YATL_QUIET")) and (strcmp(getenv("YATL_QUIET"), "1") == 0))
+ { }
+ else
+ {
+ opt_quiet= true;
+ }
+ }
+
+ if (opt_quiet)
+ {
+ close(STDOUT_FILENO);
+ }
+
+ char buffer[1024];
+ if (getenv("LIBTEST_TMP"))
+ {
+ snprintf(buffer, sizeof(buffer), "%s", getenv("LIBTEST_TMP"));
+ }
+ else
+ {
+ snprintf(buffer, sizeof(buffer), "%s", LIBTEST_TEMP);
+ }
+
+ if (chdir(buffer) == -1)
+ {
+ char getcwd_buffer[1024];
+ char *dir= getcwd(getcwd_buffer, sizeof(getcwd_buffer));
+
+ Error << "Unable to chdir() from " << dir << " to " << buffer << " errno:" << strerror(errno);
+ return EXIT_FAILURE;
+ }
+
+ if (libtest::libtool() == NULL)
+ {
+ Error << "Failed to locate libtool";
+ return EXIT_FAILURE;
+ }
+
+ int exit_code;
+
+ try {
+ do {
+ exit_code= EXIT_SUCCESS;
+ Framework world;
+
+ fatal_assert(sigignore(SIGPIPE) == 0);
+
+ libtest::SignalThread signal;
+ if (signal.setup() == false)
+ {
+ Error << "Failed to setup signals";
+ return EXIT_FAILURE;
+ }
+
+ Stats stats;
+
+ get_world(&world);
+
+ test_return_t error;
+ void *creators_ptr= world.create(error);
+
+ switch (error)
+ {
+ case TEST_SUCCESS:
+ break;
+
+ case TEST_SKIPPED:
+ Out << "SKIP " << argv[0];
+ return EXIT_SUCCESS;
+
+ case TEST_FAILURE:
+ return EXIT_FAILURE;
+ }
+
+ if (getenv("YATL_COLLECTION_TO_RUN"))
+ {
+ if (strlen(getenv("YATL_COLLECTION_TO_RUN")))
+ {
+ collection_to_run= getenv("YATL_COLLECTION_TO_RUN");
+ }
+ }
+
+ if (collection_to_run.compare("none") == 0)
+ {
+ return EXIT_SUCCESS;
+ }
+
+ if (collection_to_run.empty() == false)
+ {
+ Out << "Only testing " << collection_to_run;
+ }
+
+ char *wildcard= NULL;
+ if (argc == 3)
+ {
+ wildcard= argv[2];
+ }
+
+ for (collection_st *next= world.collections; next and next->name and (not signal.is_shutdown()); next++)
+ {
+ bool failed= false;
+ bool skipped= false;
+
+ if (collection_to_run.empty() == false and fnmatch(collection_to_run.c_str(), next->name, 0))
+ {
+ continue;
+ }
+
+ stats.collection_total++;
+
+ test_return_t collection_rc= world.startup(creators_ptr);
+
+ if (collection_rc == TEST_SUCCESS and next->pre)
+ {
+ collection_rc= world.runner()->pre(next->pre, creators_ptr);
+ }
+
+ switch (collection_rc)
+ {
+ case TEST_SUCCESS:
+ break;
+
+ case TEST_FAILURE:
+ Out << next->name << " [ failed ]";
+ failed= true;
+ signal.set_shutdown(SHUTDOWN_GRACEFUL);
+ goto cleanup;
+
+ case TEST_SKIPPED:
+ Out << next->name << " [ skipping ]";
+ skipped= true;
+ goto cleanup;
+
+ default:
+ fatal_message("invalid return code");
+ }
+
+ Out << "Collection: " << next->name;
+
+ for (test_st *run= next->tests; run->name; run++)
+ {
+ struct timeval start_time, end_time;
+ long int load_time= 0;
+
+ if (wildcard && fnmatch(wildcard, run->name, 0))
+ {
+ continue;
+ }
+
+ test_return_t return_code;
+ try {
+ if (test_success(return_code= world.item.startup(creators_ptr)))
+ {
+ if (test_success(return_code= world.item.flush(creators_ptr, run)))
+ {
+ // @note pre will fail is SKIPPED is returned
+ if (test_success(return_code= world.item.pre(creators_ptr)))
+ {
+ { // Runner Code
+ gettimeofday(&start_time, NULL);
+ assert(world.runner());
+ assert(run->test_fn);
+ try
+ {
+ return_code= world.runner()->run(run->test_fn, creators_ptr);
+ }
+ // Special case where check for the testing of the exception
+ // system.
+ catch (libtest::fatal &e)
+ {
+ if (fatal::is_disabled())
+ {
+ fatal::increment_disabled_counter();
+ return_code= TEST_SUCCESS;
+ }
+ else
+ {
+ throw;
+ }
+ }
+
+ gettimeofday(&end_time, NULL);
+ load_time= timedif(end_time, start_time);
+ }
+ }
+
+ // @todo do something if post fails
+ (void)world.item.post(creators_ptr);
+ }
+ else if (return_code == TEST_SKIPPED)
+ { }
+ else if (return_code == TEST_FAILURE)
+ {
+ Error << " item.flush(failure)";
+ signal.set_shutdown(SHUTDOWN_GRACEFUL);
+ }
+ }
+ else if (return_code == TEST_SKIPPED)
+ { }
+ else if (return_code == TEST_FAILURE)
+ {
+ Error << " item.startup(failure)";
+ signal.set_shutdown(SHUTDOWN_GRACEFUL);
+ }
+ }
+
+ catch (libtest::fatal &e)
+ {
+ Error << "Fatal exception was thrown: " << e.what();
+ return_code= TEST_FAILURE;
+ }
+ catch (std::exception &e)
+ {
+ Error << "Exception was thrown: " << e.what();
+ return_code= TEST_FAILURE;
+ }
+ catch (...)
+ {
+ Error << "Unknown exception occurred";
+ return_code= TEST_FAILURE;
+ }
+
+ stats.total++;
+
+ switch (return_code)
+ {
+ case TEST_SUCCESS:
+ Out << "\tTesting " << run->name << "\t\t\t\t\t" << load_time / 1000 << "." << load_time % 1000 << "[ " << test_strerror(return_code) << " ]";
+ stats.success++;
+ break;
+
+ case TEST_FAILURE:
+ stats.failed++;
+ failed= true;
+ Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
+ break;
+
+ case TEST_SKIPPED:
+ stats.skipped++;
+ skipped= true;
+ Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
+ break;
+
+ default:
+ fatal_message("invalid return code");
+ }
+
+ if (test_failed(world.on_error(return_code, creators_ptr)))
+ {
+ Error << "Failed while running on_error()";
+ signal.set_shutdown(SHUTDOWN_GRACEFUL);
+ break;
+ }
+ }
+
+ (void) world.runner()->post(next->post, creators_ptr);
+
+cleanup:
+ if (failed == false and skipped == false)
+ {
+ stats.collection_success++;
+ }
+
+ if (failed)
+ {
+ stats.collection_failed++;
+ }
+
+ if (skipped)
+ {
+ stats.collection_skipped++;
+ }
+
+ world.shutdown(creators_ptr);
+ Outn();
+ }
+
+ if (not signal.is_shutdown())
+ {
+ signal.set_shutdown(SHUTDOWN_GRACEFUL);
+ }
+
+ shutdown_t status= signal.get_shutdown();
+ if (status == SHUTDOWN_FORCED)
+ {
+ Out << "Tests were aborted.";
+ exit_code= EXIT_FAILURE;
+ }
+ else if (stats.collection_failed)
+ {
+ Out << "Some test failed.";
+ exit_code= EXIT_FAILURE;
+ }
+ else if (stats.collection_skipped and stats.collection_failed and stats.collection_success)
+ {
+ Out << "Some tests were skipped.";
+ }
+ else if (stats.collection_success and stats.collection_failed == 0)
+ {
+ Out << "All tests completed successfully.";
+ }
+
+ stats_print(&stats);
+
+ Outn(); // Generate a blank to break up the messages if make check/test has been run
+ } while (exit_code == EXIT_SUCCESS and --opt_repeat);
+ }
+ catch (libtest::fatal& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
+ catch (std::exception& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
+ catch (...)
+ {
+ std::cerr << "Unknown exception halted execution." << std::endl;
+ }
+
+ return exit_code;
+}
{
if (_app.check())
{
+ _app.slurp();
continue;
}
}
throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
- "Failed to ping(), waited: %u server started, having pid_file. exec: %s stderr:%s",
+ "Failed native ping(), pid: %d is alive: %s waited: %u server started, having pid_file. exec: %s stderr:%s",
+ int(_app.pid()),
+ _app.check() ? "true" : "false",
this_wait, _running.c_str(),
_app.stderr_c_str());
}
else
{
throw libtest::fatal(LIBYATL_DEFAULT_PARAM,
- "Failed to ping(), waited: %u server started. exec: %s stderr:%s",
+ "Failed native ping(), pid: %d is alive: %s waited: %u server started. exec: %s stderr:%s",
+ int(_app.pid()),
+ _app.check() ? "true" : "false",
this_wait,
_running.c_str(),
_app.stderr_c_str());
{
// Set a log file if it was requested (and we can)
- if (false and has_log_file_option())
+ if (has_log_file_option())
{
set_log_file();
log_file_option(app, _log_file);
}
}
}
+ else if (server_type.compare("drizzled") == 0)
+ {
+ if (DRIZZLED_BINARY)
+ {
+ if (HAVE_LIBDRIZZLE)
+ {
+ server= build_drizzled("localhost", try_port);
+ }
+ }
+ }
else if (server_type.compare("blobslap_worker") == 0)
{
if (GEARMAND_BINARY)
+++ /dev/null
-/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
- *
- * libtest
- *
- * Copyright (C) 2011 Data Differential, http://datadifferential.com/
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <config.h>
-#include <libtest/common.h>
-
-#include <cassert>
-#include <cstdlib>
-#include <cstring>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <ctime>
-#include <fnmatch.h>
-#include <iostream>
-
-#include <signal.h>
-
-#ifndef __INTEL_COMPILER
-#pragma GCC diagnostic ignored "-Wold-style-cast"
-#endif
-
-using namespace libtest;
-
-static void stats_print(Stats *stats)
-{
- if (stats->collection_failed == 0 and stats->collection_success == 0)
- {
- return;
- }
-
- Out << "\tTotal Collections\t\t\t\t" << stats->collection_total;
- Out << "\tFailed Collections\t\t\t\t" << stats->collection_failed;
- Out << "\tSkipped Collections\t\t\t\t" << stats->collection_skipped;
- Out << "\tSucceeded Collections\t\t\t\t" << stats->collection_success;
- Outn();
- Out << "Total\t\t\t\t" << stats->total;
- Out << "\tFailed\t\t\t" << stats->failed;
- Out << "\tSkipped\t\t\t" << stats->skipped;
- Out << "\tSucceeded\t\t" << stats->success;
-}
-
-static long int timedif(struct timeval a, struct timeval b)
-{
- long us, s;
-
- us = (long)(a.tv_usec - b.tv_usec);
- us /= 1000;
- s = (long)(a.tv_sec - b.tv_sec);
- s *= 1000;
- return s + us;
-}
-
-#include <getopt.h>
-#include <unistd.h>
-
-int main(int argc, char *argv[])
-{
- bool opt_massive= false;
- unsigned long int opt_repeat= 1; // Run all tests once
- bool opt_quiet= false;
- std::string collection_to_run;
-
- // Options parsing
- {
- enum long_option_t {
- OPT_LIBYATL_VERSION,
- OPT_LIBYATL_MATCH_COLLECTION,
- OPT_LIBYATL_MASSIVE,
- OPT_LIBYATL_QUIET,
- OPT_LIBYATL_REPEAT
- };
-
- static struct option long_options[]=
- {
- { "version", no_argument, NULL, OPT_LIBYATL_VERSION },
- { "quiet", no_argument, NULL, OPT_LIBYATL_QUIET },
- { "repeat", no_argument, NULL, OPT_LIBYATL_REPEAT },
- { "collection", required_argument, NULL, OPT_LIBYATL_MATCH_COLLECTION },
- { "massive", no_argument, NULL, OPT_LIBYATL_MASSIVE },
- { 0, 0, 0, 0 }
- };
-
- int option_index= 0;
- while (1)
- {
- int option_rv= getopt_long(argc, argv, "", long_options, &option_index);
- if (option_rv == -1)
- {
- break;
- }
-
- switch (option_rv)
- {
- case OPT_LIBYATL_VERSION:
- break;
-
- case OPT_LIBYATL_QUIET:
- opt_quiet= true;
- break;
-
- case OPT_LIBYATL_REPEAT:
- opt_repeat= strtoul(optarg, (char **) NULL, 10);
- break;
-
- case OPT_LIBYATL_MATCH_COLLECTION:
- collection_to_run= optarg;
- break;
-
- case OPT_LIBYATL_MASSIVE:
- opt_massive= true;
- break;
-
- case '?':
- /* getopt_long already printed an error message. */
- Error << "unknown option to getopt_long()";
- exit(EXIT_FAILURE);
-
- default:
- break;
- }
- }
- }
-
- srandom((unsigned int)time(NULL));
-
- if (bool(getenv("YATL_REPEAT")) and (strtoul(getenv("YATL_REPEAT"), (char **) NULL, 10) > 1))
- {
- opt_repeat= strtoul(getenv("YATL_REPEAT"), (char **) NULL, 10);
- }
-
- if ((bool(getenv("YATL_QUIET")) and (strcmp(getenv("YATL_QUIET"), "0") == 0)) or opt_quiet)
- {
- opt_quiet= true;
- }
- else if (getenv("JENKINS_URL"))
- {
- if (bool(getenv("YATL_QUIET")) and (strcmp(getenv("YATL_QUIET"), "1") == 0))
- { }
- else
- {
- opt_quiet= true;
- }
- }
-
- if (opt_quiet)
- {
- close(STDOUT_FILENO);
- }
-
- char buffer[1024];
- if (getenv("LIBTEST_TMP"))
- {
- snprintf(buffer, sizeof(buffer), "%s", getenv("LIBTEST_TMP"));
- }
- else
- {
- snprintf(buffer, sizeof(buffer), "%s", LIBTEST_TEMP);
- }
-
- if (chdir(buffer) == -1)
- {
- char getcwd_buffer[1024];
- char *dir= getcwd(getcwd_buffer, sizeof(getcwd_buffer));
-
- Error << "Unable to chdir() from " << dir << " to " << buffer << " errno:" << strerror(errno);
- return EXIT_FAILURE;
- }
-
- if (libtest::libtool() == NULL)
- {
- Error << "Failed to locate libtool";
- return EXIT_FAILURE;
- }
-
- int exit_code;
-
- try {
- do {
- exit_code= EXIT_SUCCESS;
- Framework world;
-
- fatal_assert(sigignore(SIGPIPE) == 0);
-
- libtest::SignalThread signal;
- if (signal.setup() == false)
- {
- Error << "Failed to setup signals";
- return EXIT_FAILURE;
- }
-
- Stats stats;
-
- get_world(&world);
-
- test_return_t error;
- void *creators_ptr= world.create(error);
-
- switch (error)
- {
- case TEST_SUCCESS:
- break;
-
- case TEST_SKIPPED:
- Out << "SKIP " << argv[0];
- return EXIT_SUCCESS;
-
- case TEST_FAILURE:
- return EXIT_FAILURE;
- }
-
- if (getenv("YATL_COLLECTION_TO_RUN"))
- {
- if (strlen(getenv("YATL_COLLECTION_TO_RUN")))
- {
- collection_to_run= getenv("YATL_COLLECTION_TO_RUN");
- }
- }
-
- if (collection_to_run.compare("none") == 0)
- {
- return EXIT_SUCCESS;
- }
-
- if (collection_to_run.empty() == false)
- {
- Out << "Only testing " << collection_to_run;
- }
-
- char *wildcard= NULL;
- if (argc == 3)
- {
- wildcard= argv[2];
- }
-
- for (collection_st *next= world.collections; next and next->name and (not signal.is_shutdown()); next++)
- {
- bool failed= false;
- bool skipped= false;
-
- if (collection_to_run.empty() == false and fnmatch(collection_to_run.c_str(), next->name, 0))
- {
- continue;
- }
-
- stats.collection_total++;
-
- test_return_t collection_rc= world.startup(creators_ptr);
-
- if (collection_rc == TEST_SUCCESS and next->pre)
- {
- collection_rc= world.runner()->pre(next->pre, creators_ptr);
- }
-
- switch (collection_rc)
- {
- case TEST_SUCCESS:
- break;
-
- case TEST_FAILURE:
- Out << next->name << " [ failed ]";
- failed= true;
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
- goto cleanup;
-
- case TEST_SKIPPED:
- Out << next->name << " [ skipping ]";
- skipped= true;
- goto cleanup;
-
- default:
- fatal_message("invalid return code");
- }
-
- Out << "Collection: " << next->name;
-
- for (test_st *run= next->tests; run->name; run++)
- {
- struct timeval start_time, end_time;
- long int load_time= 0;
-
- if (wildcard && fnmatch(wildcard, run->name, 0))
- {
- continue;
- }
-
- test_return_t return_code;
- try {
- if (test_success(return_code= world.item.startup(creators_ptr)))
- {
- if (test_success(return_code= world.item.flush(creators_ptr, run)))
- {
- // @note pre will fail is SKIPPED is returned
- if (test_success(return_code= world.item.pre(creators_ptr)))
- {
- { // Runner Code
- gettimeofday(&start_time, NULL);
- assert(world.runner());
- assert(run->test_fn);
- try
- {
- return_code= world.runner()->run(run->test_fn, creators_ptr);
- }
- // Special case where check for the testing of the exception
- // system.
- catch (libtest::fatal &e)
- {
- if (fatal::is_disabled())
- {
- fatal::increment_disabled_counter();
- return_code= TEST_SUCCESS;
- }
- else
- {
- throw;
- }
- }
-
- gettimeofday(&end_time, NULL);
- load_time= timedif(end_time, start_time);
- }
- }
-
- // @todo do something if post fails
- (void)world.item.post(creators_ptr);
- }
- else if (return_code == TEST_SKIPPED)
- { }
- else if (return_code == TEST_FAILURE)
- {
- Error << " item.flush(failure)";
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
- }
- }
- else if (return_code == TEST_SKIPPED)
- { }
- else if (return_code == TEST_FAILURE)
- {
- Error << " item.startup(failure)";
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
- }
- }
-
- catch (libtest::fatal &e)
- {
- Error << "Fatal exception was thrown: " << e.what();
- return_code= TEST_FAILURE;
- }
- catch (std::exception &e)
- {
- Error << "Exception was thrown: " << e.what();
- return_code= TEST_FAILURE;
- }
- catch (...)
- {
- Error << "Unknown exception occurred";
- return_code= TEST_FAILURE;
- }
-
- stats.total++;
-
- switch (return_code)
- {
- case TEST_SUCCESS:
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << load_time / 1000 << "." << load_time % 1000 << "[ " << test_strerror(return_code) << " ]";
- stats.success++;
- break;
-
- case TEST_FAILURE:
- stats.failed++;
- failed= true;
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
- break;
-
- case TEST_SKIPPED:
- stats.skipped++;
- skipped= true;
- Out << "\tTesting " << run->name << "\t\t\t\t\t" << "[ " << test_strerror(return_code) << " ]";
- break;
-
- default:
- fatal_message("invalid return code");
- }
-
- if (test_failed(world.on_error(return_code, creators_ptr)))
- {
- Error << "Failed while running on_error()";
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
- break;
- }
- }
-
- (void) world.runner()->post(next->post, creators_ptr);
-
-cleanup:
- if (failed == false and skipped == false)
- {
- stats.collection_success++;
- }
-
- if (failed)
- {
- stats.collection_failed++;
- }
-
- if (skipped)
- {
- stats.collection_skipped++;
- }
-
- world.shutdown(creators_ptr);
- Outn();
- }
-
- if (not signal.is_shutdown())
- {
- signal.set_shutdown(SHUTDOWN_GRACEFUL);
- }
-
- shutdown_t status= signal.get_shutdown();
- if (status == SHUTDOWN_FORCED)
- {
- Out << "Tests were aborted.";
- exit_code= EXIT_FAILURE;
- }
- else if (stats.collection_failed)
- {
- Out << "Some test failed.";
- exit_code= EXIT_FAILURE;
- }
- else if (stats.collection_skipped and stats.collection_failed and stats.collection_success)
- {
- Out << "Some tests were skipped.";
- }
- else if (stats.collection_success and stats.collection_failed == 0)
- {
- Out << "All tests completed successfully.";
- }
-
- stats_print(&stats);
-
- Outn(); // Generate a blank to break up the messages if make check/test has been run
- } while (exit_code == EXIT_SUCCESS and --opt_repeat);
- }
- catch (libtest::fatal& e)
- {
- std::cerr << e.what() << std::endl;
- }
- catch (std::exception& e)
- {
- std::cerr << e.what() << std::endl;
- }
- catch (...)
- {
- std::cerr << "Unknown exception halted execution." << std::endl;
- }
-
- return exit_code;
-}
return TEST_SUCCESS;
}
+static test_return_t var_drizzle_exists_test(void *)
+{
+ test_compare(0, access("var/drizzle", R_OK | W_OK | X_OK));
+ return TEST_SUCCESS;
+}
+
static test_return_t var_tmp_test(void *)
{
FILE *file= fopen("var/tmp/junk", "w+");
return TEST_SUCCESS;
}
+static test_return_t var_drizzle_test(void *)
+{
+ FILE *file= fopen("var/drizzle/junk", "w+");
+ test_true(file);
+ fclose(file);
+ return TEST_SUCCESS;
+}
+
static test_return_t var_tmp_rm_test(void *)
{
test_true(unlink("var/tmp/junk") == 0);
return TEST_SUCCESS;
}
+static test_return_t var_drizzle_rm_test(void *)
+{
+ test_true(unlink("var/drizzle/junk") == 0);
+ return TEST_SUCCESS;
+}
+
static test_return_t _compare_test_return_t_test(void *)
{
test_compare(TEST_SUCCESS, TEST_SUCCESS);
return TEST_SUCCESS;
}
+static test_return_t drizzled_cycle_test(void *object)
+{
+ server_startup_st *servers= (server_startup_st*)object;
+ test_true(servers and servers->validate());
+
+#if defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY
+ test_true(has_drizzled_binary());
+#endif
+
+ test_skip(true, has_drizzled_binary());
+
+ test_true(server_startup(*servers, "drizzled", get_free_port(), 0, NULL));
+
+ return TEST_SUCCESS;
+}
+
static test_return_t gearmand_cycle_test(void *object)
{
server_startup_st *servers= (server_startup_st*)object;
test_skip_valgrind();
Application true_app("doesnotexist");
+ true_app.will_fail();
const char *args[]= { "--fubar", 0 };
#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
return TEST_SUCCESS;
}
+static test_return_t check_for_drizzle(void *)
+{
+ test_skip(true, HAVE_LIBDRIZZLE);
+ test_skip(true, has_drizzled_binary());
+ return TEST_SUCCESS;
+}
+
+
+test_st drizzled_tests[] ={
+ {"drizzled startup-shutdown", 0, drizzled_cycle_test },
+ {0, 0, 0}
+};
test_st gearmand_tests[] ={
#if 0
{"var/tmp exists", 0, var_tmp_exists_test },
{"var/run exists", 0, var_run_exists_test },
{"var/log exists", 0, var_log_exists_test },
+ {"var/drizzle exists", 0, var_drizzle_exists_test },
{"var/tmp", 0, var_tmp_test },
{"var/run", 0, var_run_test },
{"var/log", 0, var_log_test },
+ {"var/drizzle", 0, var_drizzle_test },
{"var/tmp rm", 0, var_tmp_rm_test },
{"var/run rm", 0, var_run_rm_test },
{"var/log rm", 0, var_log_rm_test },
+ {"var/drizzle rm", 0, var_drizzle_rm_test },
{0, 0, 0}
};
{"comparison", 0, 0, comparison_tests},
{"gearmand", check_for_gearman, 0, gearmand_tests},
{"memcached", check_for_libmemcached, 0, memcached_tests},
+ {"drizzled", check_for_drizzle, 0, drizzled_tests},
{"cmdline", 0, 0, cmdline_tests},
{"application", 0, 0, application_tests},
{"http", check_for_curl, 0, http_tests},
world->collection_startup= (test_callback_fn*)world_container_startup;
world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new LibmemcachedRunner);
global_framework= world;
}
noinst_HEADERS+= tests/hash_results.h
noinst_HEADERS+= tests/libmemcached_world.h
noinst_HEADERS+= tests/libmemcached_world_socket.h
+noinst_HEADERS+= tests/runner.h
# Cycle should always run first
tests_cycle_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
include tests/libmemcached-1.0/include.am
-tests_failure_SOURCES= tests/failure.cc
+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_CXXFLAGS = $(AM_CXXFLAGS)
tests_failure_DEPENDENCIES= $(TESTS_LDADDS)
tests_failure_LDADD= $(tests_failure_DEPENDENCIES)
world->collection_startup= (test_callback_fn*)world_container_startup;
world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new LibmemcachedRunner);
world->set_socket();
}
};
test_st generate_tests[] ={
- {"generate_pairs", true, (test_callback_fn*)generate_pairs },
{"generate_data", true, (test_callback_fn*)generate_data },
{"get_read", false, (test_callback_fn*)get_read },
{"delete_generate", false, (test_callback_fn*)delete_generate },
- {"generate_buffer_data", true, (test_callback_fn*)generate_buffer_data },
- {"delete_buffer", false, (test_callback_fn*)delete_buffer_generate},
+ {"cleanup", true, (test_callback_fn*)cleanup_pairs },
+ {0, 0, (test_callback_fn*)0}
+};
+ // New start
+test_st generate_mget_TESTS[] ={
{"generate_data", true, (test_callback_fn*)generate_data },
{"mget_read", false, (test_callback_fn*)mget_read },
{"mget_read_result", false, (test_callback_fn*)mget_read_result },
{"memcached_fetch_result() partial read", false, (test_callback_fn*)mget_read_partial_result },
{"mget_read_function", false, (test_callback_fn*)mget_read_function },
{"cleanup", true, (test_callback_fn*)cleanup_pairs },
+ {0, 0, (test_callback_fn*)0}
+};
+
+test_st generate_large_TESTS[] ={
{"generate_large_pairs", true, (test_callback_fn*)generate_large_pairs },
- {"generate_data", true, (test_callback_fn*)generate_data },
- {"generate_buffer_data", true, (test_callback_fn*)generate_buffer_data },
{"cleanup", true, (test_callback_fn*)cleanup_pairs },
{0, 0, (test_callback_fn*)0}
};
test_st consistent_tests[] ={
- {"generate_pairs", true, (test_callback_fn*)generate_pairs },
{"generate_data", true, (test_callback_fn*)generate_data },
{"get_read", 0, (test_callback_fn*)get_read_count },
{"cleanup", true, (test_callback_fn*)cleanup_pairs },
};
test_st consistent_weighted_tests[] ={
- {"generate_pairs", true, (test_callback_fn*)generate_pairs },
{"generate_data", true, (test_callback_fn*)generate_data_with_stats },
{"get_read", false, (test_callback_fn*)get_read_count },
{"cleanup", true, (test_callback_fn*)cleanup_pairs },
{"Cal Haldenbrand's tests", 0, 0, haldenbrand_TESTS},
{"user written tests", 0, 0, user_tests},
{"generate", 0, 0, generate_tests},
+ {"generate MEMCACHED_BEHAVIOR_BUFFER_REQUESTS", (test_callback_fn*)pre_buffer, 0, generate_tests},
+ {"mget generate MEMCACHED_BEHAVIOR_BUFFER_REQUESTS", (test_callback_fn*)pre_buffer, 0, generate_mget_TESTS},
+ {"generate large", 0, 0, generate_large_TESTS},
{"generate_hsieh", (test_callback_fn*)pre_hsieh, 0, generate_tests},
{"generate_ketama", (test_callback_fn*)pre_behavior_ketama, 0, generate_tests},
{"generate_hsieh_consistent", (test_callback_fn*)enable_consistent_hsieh, 0, generate_tests},
{"generate_murmur", (test_callback_fn*)pre_murmur, 0, generate_tests},
{"generate_jenkins", (test_callback_fn*)pre_jenkins, 0, generate_tests},
{"generate_nonblock", (test_callback_fn*)pre_nonblock, 0, generate_tests},
- // Too slow
- {"generate_corked", (test_callback_fn*)pre_cork, 0, generate_tests},
- {"generate_corked_and_nonblock", (test_callback_fn*)pre_cork_and_nonblock, 0, generate_tests},
+ {"mget generate_nonblock", (test_callback_fn*)pre_nonblock, 0, generate_mget_TESTS},
{"consistent_not", 0, 0, consistent_tests},
{"consistent_ketama", (test_callback_fn*)pre_behavior_ketama, 0, consistent_tests},
{"consistent_ketama_weighted", (test_callback_fn*)pre_behavior_ketama_weighted, 0, consistent_weighted_tests},
world->collection_startup= (test_callback_fn*)world_container_startup;
world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new LibmemcachedRunner);
}
world->collection_startup= (test_callback_fn*)world_container_startup;
world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new LibmemcachedRunner);
}
using namespace libtest;
-static pairs_st *global_pairs;
+static pairs_st *global_pairs= NULL;
static const char *global_keys[GLOBAL_COUNT];
static size_t global_keys_length[GLOBAL_COUNT];
static size_t global_count= 0;
-test_return_t cleanup_pairs(memcached_st *memc)
+test_return_t cleanup_pairs(memcached_st*)
{
- (void)memc;
pairs_free(global_pairs);
+ global_pairs= NULL;
return TEST_SUCCESS;
}
-test_return_t generate_pairs(memcached_st *)
+static test_return_t generate_pairs(memcached_st *)
{
global_pairs= pairs_generate(GLOBAL_COUNT, 400);
global_count= GLOBAL_COUNT;
return TEST_SUCCESS;
}
-test_return_t generate_large_pairs(memcached_st *)
+test_return_t generate_large_pairs(memcached_st *memc)
{
global_pairs= pairs_generate(GLOBAL2_COUNT, MEMCACHED_MAX_BUFFER+10);
global_count= GLOBAL2_COUNT;
global_keys_length[x]= global_pairs[x].key_length;
}
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, true);
+ unsigned int check_execute= execute_set(memc, global_pairs, global_count);
+
+ test_compare_warn_hint(global_count, check_execute, "Possible false, positive, memcached may have ejected key/value based on memory needs");
+
return TEST_SUCCESS;
}
test_return_t generate_data(memcached_st *memc)
{
+ test_compare(TEST_SUCCESS, generate_pairs(memc));
+
unsigned int check_execute= execute_set(memc, global_pairs, global_count);
test_compare_warn_hint(global_count, check_execute, "Possible false, positive, memcached may have ejected key/value based on memory needs");
test_return_t generate_data_with_stats(memcached_st *memc)
{
+ test_compare(TEST_SUCCESS, generate_pairs(memc));
+
unsigned int check_execute= execute_set(memc, global_pairs, global_count);
test_compare(check_execute, global_count);
test_return_t generate_data(memcached_st*);
test_return_t generate_data_with_stats(memcached_st*);
test_return_t generate_large_pairs(memcached_st *);
-test_return_t generate_pairs(memcached_st*);
test_return_t get_read(memcached_st*);
test_return_t get_read_count(memcached_st*);
test_return_t mget_read(memcached_st*);
tests_libmemcached_1_0_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
tests_libmemcached_1_0_testapp_SOURCES=
tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/all_tests.cc
+tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/generate.cc
tests_libmemcached_1_0_testapp_SOURCES+= \
tests/libmemcached-1.0/basic.cc \
- tests/libmemcached-1.0/callback_counter.cc \
tests/libmemcached-1.0/callbacks.cc \
tests/libmemcached-1.0/debug.cc \
tests/libmemcached-1.0/deprecated.cc \
tests/libmemcached-1.0/encoding_key.cc \
tests/libmemcached-1.0/error_conditions.cc \
tests/libmemcached-1.0/exist.cc \
- tests/libmemcached-1.0/fetch_all_results.cc \
- tests/libmemcached-1.0/generate.cc \
tests/libmemcached-1.0/haldenbrand.cc \
tests/libmemcached-1.0/ketama.cc \
tests/libmemcached-1.0/mem_functions.cc \
tests_libmemcached_1_0_testsocket_SOURCES= \
tests/libmemcached-1.0/all_tests_socket.cc \
tests/libmemcached-1.0/basic.cc \
- tests/libmemcached-1.0/callback_counter.cc \
tests/libmemcached-1.0/callbacks.cc \
tests/libmemcached-1.0/debug.cc \
tests/libmemcached-1.0/deprecated.cc \
tests/libmemcached-1.0/encoding_key.cc \
tests/libmemcached-1.0/error_conditions.cc \
tests/libmemcached-1.0/exist.cc \
- tests/libmemcached-1.0/fetch_all_results.cc \
- tests/libmemcached-1.0/generate.cc \
tests/libmemcached-1.0/haldenbrand.cc \
tests/libmemcached-1.0/ketama.cc \
tests/libmemcached-1.0/mem_functions.cc \
tests/libmemcached-1.0/touch.cc \
tests/libmemcached-1.0/virtual_buckets.cc
-tests_libmemcached_1_0_testsocket_SOURCES+= clients/generator.cc clients/execute.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= clients/generator.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= clients/execute.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= tests/libmemcached-1.0/generate.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
tests_libmemcached_1_0_testsocket_DEPENDENCIES= \
libmemcached/libmemcached.la \
libtest/libtest.la \
tests/libmemcached-1.0/replication.cc \
tests/libmemcached-1.0/sasl.cc \
tests/libmemcached-1.0/virtual_buckets.cc
-tests_libmemcached_1_0_sasl_SOURCES+= clients/generator.cc clients/execute.cc
+tests_libmemcached_1_0_sasl_SOURCES+= clients/execute.cc
+tests_libmemcached_1_0_sasl_SOURCES+= clients/generator.cc
+tests_libmemcached_1_0_sasl_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_libmemcached_1_0_sasl_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_libmemcached_1_0_sasl_SOURCES+= tests/libmemcached-1.0/generate.cc
+
tests_libmemcached_1_0_sasl_DEPENDENCIES= \
libmemcached/libmemcached.la \
libtest/libtest.la
noinst_PROGRAMS+= tests/atomsmasher
tests_testudp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
-tests_testudp_SOURCES= tests/mem_udp.cc
+tests_testudp_SOURCES=
+
+tests_testudp_SOURCES+= tests/mem_udp.cc
+tests_testudp_SOURCES+= clients/execute.cc
+tests_testudp_SOURCES+= clients/generator.cc
+tests_testudp_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_testudp_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_testudp_SOURCES+= tests/libmemcached-1.0/generate.cc
+
tests_testudp_DEPENDENCIES= $(TESTS_LDADDS)
tests_testudp_LDADD= $(tests_testudp_DEPENDENCIES)
check_PROGRAMS+= tests/testudp
test-udp: tests/testudp
@tests/testudp
-tests_testplus_SOURCES= tests/libmemcached-1.0/plus.cpp
+tests_testplus_SOURCES=
+
+tests_testplus_SOURCES+= tests/libmemcached-1.0/plus.cpp
+tests_testplus_SOURCES+= clients/execute.cc
+tests_testplus_SOURCES+= clients/generator.cc
+tests_testplus_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_testplus_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_testplus_SOURCES+= tests/libmemcached-1.0/generate.cc
+
tests_testplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
tests_testplus_DEPENDENCIES= $(TESTS_LDADDS)
tests_testplus_LDADD= $(tests_testplus_DEPENDENCIES)
memcached_return_t rc;
char *out_value= memcached_get(memc, keys.key_at(which_key), keys.length_at(which_key),
&value_length, &flags, &rc);
- test_compare(MEMCACHED_SUCCESS, rc);
+ if (rc == MEMCACHED_NOTFOUND)
+ { } // It is possible that the value has been purged.
+ else
+ {
+ test_compare_hint(MEMCACHED_SUCCESS, rc, memcached_last_error_message(memc));
+ }
test_null(out_value);
test_zero(value_length);
test_zero(flags);
world->collection_startup= reinterpret_cast<test_callback_fn*>(world_container_startup);
world->collection_shutdown= reinterpret_cast<test_callback_fn*>(world_container_shutdown);
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new LibmemcachedRunner);
}
world->collection_startup= (test_callback_fn*)world_container_startup;
world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new LibmemcachedRunner);
world->set_sasl("memcached", "memcached");
}
return TEST_SUCCESS;
}
+test_return_t pre_buffer(memcached_st *memc)
+{
+ test_skip(MEMCACHED_SUCCESS, memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, true));
+
+ return TEST_SUCCESS;
+}
+
test_return_t pre_unix_socket(memcached_st *memc)
{
struct stat buf;
return TEST_SUCCESS;
}
-test_return_t pre_cork(memcached_st *memc)
-{
-#ifdef __APPLE__
- return TEST_SKIPPED;
-#endif
- bool set= true;
- if (memcached_success(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_CORK, set)))
- return TEST_SUCCESS;
-
- return TEST_SKIPPED;
-}
-
-test_return_t pre_cork_and_nonblock(memcached_st *memc)
-{
-#ifdef __APPLE__
- return TEST_SKIPPED;
-#endif
- test_return_t test_rc;
- if ((test_rc= pre_cork(memc)) != TEST_SUCCESS)
- return test_rc;
-
- return pre_nonblock(memc);
-}
-
test_return_t pre_nonblock_binary(memcached_st *memc)
{
memcached_st *memc_clone= memcached_clone(NULL, memc);
test_return_t pre_replication_noblock(memcached_st*);
test_return_t pre_settimer(memcached_st*);
test_return_t pre_unix_socket(memcached_st*);
+test_return_t pre_buffer(memcached_st*);
typedef test_return_t (*libmemcached_test_callback_fn)(memcached_st *);
-class LibmemcachedRunner : public libtest::Runner {
-public:
- test_return_t run(test_callback_fn* func, void *object)
- {
- return _runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
- }
-
- test_return_t pre(test_callback_fn* func, void *object)
- {
- return _pre_runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
- }
-
- test_return_t post(test_callback_fn* func, void *object)
- {
- return _post_runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
- }
-
-private:
- test_return_t _runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
- {
- test_compare(true, check());
-
- if (func)
- {
- test_true(container);
- test_true(container->memc);
- test_return_t ret;
- try {
- ret= func(container->memc);
- }
- catch (std::exception& e)
- {
- libtest::Error << e.what();
- return TEST_FAILURE;
- }
-
- return ret;
- }
-
- return TEST_SUCCESS;
- }
-
- test_return_t _pre_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
- {
- if (func)
- {
- return func(container->parent);
- }
-
- return TEST_SUCCESS;
- }
-
- test_return_t _post_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
- {
- if (func)
- {
- return func(container->parent);
- }
-
- return TEST_SUCCESS;
- }
-};
-
-static LibmemcachedRunner defualt_libmemcached_runner;
+#include "tests/runner.h"
typedef test_return_t (*libmemcached_test_callback_fn)(memcached_st *);
-static test_return_t _runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
-{
- if (func)
- {
- test_true(container);
- test_true(container->memc);
- test_return_t ret;
- try {
- ret= func(container->memc);
- }
- catch (std::exception& e)
- {
- libtest::Error << e.what();
- return TEST_FAILURE;
- }
-
- return ret;
- }
-
- return TEST_SUCCESS;
-}
-
-static test_return_t _pre_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
-{
- if (func)
- {
- return func(container->parent);
- }
-
- return TEST_SUCCESS;
-}
-
-static test_return_t _post_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
-{
- if (func)
- {
- return func(container->parent);
- }
-
- return TEST_SUCCESS;
-}
-
-class LibmemcachedRunner : public libtest::Runner {
-public:
- test_return_t run(test_callback_fn* func, void *object)
- {
- return _runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
- }
-
- test_return_t pre(test_callback_fn* func, void *object)
- {
- return _pre_runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
- }
-
- test_return_t post(test_callback_fn* func, void *object)
- {
- return _post_runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
- }
-};
-
-static LibmemcachedRunner defualt_libmemcached_runner;
+#include "tests/runner.h"
world->collection_startup= (test_callback_fn*)world_container_startup;
world->collection_shutdown= (test_callback_fn*)world_container_shutdown;
- world->set_runner(&defualt_libmemcached_runner);
+ world->set_runner(new LibmemcachedRunner);
}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached Client and Server
+ *
+ * Copyright (C) 2012 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+
+#pragma once
+
+#include "tests/libmemcached-1.0/generate.h"
+
+class LibmemcachedRunner : public libtest::Runner {
+public:
+ test_return_t run(test_callback_fn* func, void *object)
+ {
+ return _runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
+ }
+
+ test_return_t pre(test_callback_fn* func, void *object)
+ {
+ return _pre_runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
+ }
+
+ test_return_t post(test_callback_fn* func, void *object)
+ {
+ return _post_runner_default(libmemcached_test_callback_fn(func), (libmemcached_test_container_st*)object);
+ }
+
+private:
+ test_return_t _runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
+ {
+ test_compare(true, check());
+
+ if (func)
+ {
+ test_true(container);
+ test_true(container->memc);
+ test_return_t ret;
+ try {
+ ret= func(container->memc);
+ }
+ catch (std::exception& e)
+ {
+ libtest::Error << e.what();
+ return TEST_FAILURE;
+ }
+
+ return ret;
+ }
+
+ return TEST_SUCCESS;
+ }
+
+ test_return_t _pre_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
+ {
+ test_compare(true, check());
+
+ if (func)
+ {
+ return func(container->parent);
+ }
+
+ return TEST_SUCCESS;
+ }
+
+ test_return_t _post_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
+ {
+ test_compare(true, check());
+ cleanup_pairs(NULL);
+
+ if (func)
+ {
+ return func(container->parent);
+ }
+
+ return TEST_SUCCESS;
+ }
+};
+