*/
#include <config.h>
-#include <libtest/common.h>
namespace libtest {
-bool has_gearmand_binary()
-{
-#if defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY
- std::stringstream arg_buffer;
-
- if (getenv("PWD"))
- {
- arg_buffer << getenv("PWD");
- arg_buffer << "/";
- }
- arg_buffer << GEARMAND_BINARY;
-
- if (access(arg_buffer.str().c_str() ,R_OK|X_OK) == 0)
- {
- return true;
- }
-#endif
-
- 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)
- {
- return true;
- }
-#endif
-
- return false;
-}
-
-bool has_memcached_sasl_binary()
-{
-#if defined(HAVE_MEMCACHED_SASL_BINARY) && HAVE_MEMCACHED_SASL_BINARY
- if (access(MEMCACHED_SASL_BINARY, R_OK|X_OK) == 0)
- {
- return true;
- }
-#endif
-
- return false;
-}
-
}
namespace libtest {
-LIBTEST_API
-bool has_memcached_binary();
-
-LIBTEST_API
-bool has_memcached_sasl_binary();
-
-LIBTEST_API
-bool has_gearmand_binary();
-
-LIBTEST_API
-bool has_drizzled_binary();
-
} // namespace libtest
-
*/
#include <config.h>
-#include <libtest/has.hpp>
+#include <libtest/common.h>
#include <cstdlib>
+#include <unistd.h>
+
+namespace libtest {
bool has_memcached_support(void)
{
- if (HAVE_LIBMEMCACHED and HAVE_MEMCACHED_BINARY)
+ if (HAVE_LIBMEMCACHED)
{
return true;
}
return false;
}
-bool has_drizzle_support(void)
+bool has_libdrizzle(void)
{
- if (HAVE_LIBDRIZZLE and HAVE_DRIZZLED_BINARY)
+ if (HAVE_LIBDRIZZLE)
{
return true;
}
{
if (getenv("POSTGES_IS_RUNNING_AND_SETUP"))
{
-
if (HAVE_LIBPQ)
{
return true;
return false;
}
+
+
+bool has_gearmand()
+{
+ if (HAVE_GEARMAND_BINARY)
+ {
+ std::stringstream arg_buffer;
+
+ if (getenv("PWD"))
+ {
+ arg_buffer << getenv("PWD");
+ arg_buffer << "/";
+ }
+ arg_buffer << GEARMAND_BINARY;
+
+ if (access(arg_buffer.str().c_str(), X_OK) == 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool has_drizzled()
+{
+ if (HAVE_DRIZZLED_BINARY)
+ {
+ if (access(DRIZZLED_BINARY, X_OK) == 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool has_memcached()
+{
+ if (HAVE_MEMCACHED_BINARY)
+ {
+ if (access(MEMCACHED_BINARY, X_OK) == 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool has_memcached_sasl()
+{
+ if (HAVE_MEMCACHED_SASL_BINARY)
+ {
+ if (access(MEMCACHED_SASL_BINARY, X_OK) == 0)
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+} // namespace libtest
#pragma once
-bool has_memcached_support(void);
+namespace libtest {
-bool has_drizzle_support(void);
+LIBTEST_API
+bool has_libmemcached();
-bool has_postgres_support(void);
+LIBTEST_API
+bool has_libdrizzle();
+
+LIBTEST_API
+bool has_postgres_support();
+
+LIBTEST_API
+bool has_memcached();
+
+LIBTEST_API
+bool has_memcached_sasl();
+
+LIBTEST_API
+bool has_gearmand();
+
+LIBTEST_API
+bool has_drizzled();
+
+} // namespace libtest
test_true(servers and servers->validate());
#if defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY
- test_true(has_drizzled_binary());
+ test_true(has_drizzled());
#endif
- test_skip(true, has_drizzled_binary());
+ test_skip(true, has_drizzled());
test_true(server_startup(*servers, "drizzled", get_free_port(), 0, NULL));
test_true(servers and servers->validate());
#if defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY
- test_true(has_gearmand_binary());
+ test_true(has_gearmand());
#endif
- test_skip(true, has_gearmand_binary());
+ test_skip(true, has_gearmand());
test_true(server_startup(*servers, "gearmand", get_free_port(), 0, NULL));
if (MEMCACHED_BINARY and HAVE_LIBMEMCACHED)
{
- test_true(has_memcached_binary());
+ test_true(has_memcached());
test_true(server_startup(*servers, "memcached", get_free_port(), 0, NULL));
return TEST_SUCCESS;
{
if (HAVE_LIBMEMCACHED)
{
- test_true(has_memcached_binary());
+ test_true(has_memcached());
test_true(servers->start_socket_server("memcached", get_free_port(), 0, NULL));
return TEST_SUCCESS;
{
if (HAVE_LIBMEMCACHED)
{
- test_true(has_memcached_sasl_binary());
+ test_true(has_memcached_sasl());
test_true(server_startup(*servers, "memcached-sasl", get_free_port(), 0, NULL));
return TEST_SUCCESS;
static test_return_t check_for_gearman(void *)
{
test_skip(true, HAVE_LIBGEARMAN);
- test_skip(true, has_gearmand_binary());
+ test_skip(true, has_gearmand());
return TEST_SUCCESS;
}
static test_return_t check_for_drizzle(void *)
{
test_skip(true, HAVE_LIBDRIZZLE);
- test_skip(true, has_drizzled_binary());
+ test_skip(true, has_drizzled());
return TEST_SUCCESS;
}
static test_return_t check_for_libmemcached(void *)
{
test_skip(true, HAVE_LIBMEMCACHED);
- test_skip(true, has_memcached_binary());
+ test_skip(true, has_memcached());
return TEST_SUCCESS;
}
{0, 0, 0, 0}
};
-static void *world_create(server_startup_st& servers, test_return_t& )
+static void *world_create(server_startup_st& servers, test_return_t& error)
{
+ if (libtest::has_memcached() == false)
+ {
+ error= TEST_SKIPPED;
+ return NULL;
+ }
+
return &servers;
}
static void *world_create(libtest::server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(libtest::server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
{0, 0, 0, 0}
};
-static void *world_create(server_startup_st&, test_return_t&)
+static void *world_create(server_startup_st&, test_return_t& error)
{
+ if (libtest::has_memcached() == false)
+ {
+ error= TEST_SKIPPED;
+ return NULL;
+ }
+
return NULL;
}
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (HAVE_MEMCACHED_BINARY == 0)
+ if (libtest::has_memcached() == false)
{
error= TEST_SKIPPED;
return NULL;
world->collections(collection);
world->create(world_create);
}
-