From 5b9ee8fa3c250201bab38812ccb8e44c21fbddf1 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Thu, 7 Jun 2012 16:09:42 +0100 Subject: [PATCH] Merge in libtest. --- libtest/cpu.cc | 2 +- libtest/has.cc | 17 +++++++++ libtest/has.hpp | 3 ++ libtest/include.am | 83 +++++++++++++++++++++----------------------- libtest/memcached.cc | 2 ++ 5 files changed, 63 insertions(+), 44 deletions(-) diff --git a/libtest/cpu.cc b/libtest/cpu.cc index 7b04042e..bfbf5ced 100644 --- a/libtest/cpu.cc +++ b/libtest/cpu.cc @@ -72,7 +72,7 @@ size_t number_of_cpus() } } #else - fprintf(stderr, "Going with guessing\n"); + // Guessing number of CPU #endif return number_of_cpu; diff --git a/libtest/has.cc b/libtest/has.cc index 10e61cb6..72441819 100644 --- a/libtest/has.cc +++ b/libtest/has.cc @@ -111,6 +111,21 @@ bool has_drizzled() return false; } +bool has_mysqld() +{ +#if defined(HAVE_MYSQL_BUILD) && HAVE_MYSQL_BUILD + if (HAVE_MYSQL_BUILD) + { + if (access(HAVE_MYSQL, X_OK) == 0) + { + return true; + } + } +#endif + + return false; +} + bool has_memcached() { if (HAVE_MEMCACHED_BINARY) @@ -135,6 +150,7 @@ bool has_memcached() bool has_memcached_sasl() { +#if defined(HAVE_MEMCACHED_SASL_BINARY) && HAVE_MEMCACHED_SASL_BINARY if (HAVE_MEMCACHED_SASL_BINARY) { if (access(MEMCACHED_SASL_BINARY, X_OK) == 0) @@ -142,6 +158,7 @@ bool has_memcached_sasl() return true; } } +#endif return false; } diff --git a/libtest/has.hpp b/libtest/has.hpp index 68593d74..e6c9d4d5 100644 --- a/libtest/has.hpp +++ b/libtest/has.hpp @@ -59,4 +59,7 @@ bool has_gearmand(); LIBTEST_API bool has_drizzled(); +LIBTEST_API +bool has_mysqld(); + } // namespace libtest diff --git a/libtest/include.am b/libtest/include.am index b92145e4..cb393a22 100644 --- a/libtest/include.am +++ b/libtest/include.am @@ -5,7 +5,7 @@ # LIBTOOL_COMMAND= ${abs_top_builddir}/libtool --mode=execute -VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE +VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE --xml-file=./tmp_chroot/var/tmp/yatl-\%p.xml --xml=yes VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND) HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd @@ -43,45 +43,45 @@ distclean-libtest-check: -rm -rf tmp_chroot noinst_HEADERS+= libtest/timer.hpp -noinst_HEADERS+=libtest/binaries.h -noinst_HEADERS+=libtest/cpu.hpp -noinst_HEADERS+=libtest/blobslap_worker.h -noinst_HEADERS+=libtest/callbacks.h -noinst_HEADERS+=libtest/cmdline.h -noinst_HEADERS+=libtest/collection.h -noinst_HEADERS+=libtest/common.h -noinst_HEADERS+=libtest/comparison.hpp -noinst_HEADERS+=libtest/core.h -noinst_HEADERS+=libtest/dream.h -noinst_HEADERS+=libtest/error.h -noinst_HEADERS+=libtest/failed.h -noinst_HEADERS+=libtest/fatal.hpp -noinst_HEADERS+=libtest/framework.h -noinst_HEADERS+=libtest/gearmand.h -noinst_HEADERS+=libtest/drizzled.h -noinst_HEADERS+=libtest/get.h -noinst_HEADERS+=libtest/has.hpp -noinst_HEADERS+=libtest/http.hpp -noinst_HEADERS+=libtest/is_pid.hpp -noinst_HEADERS+=libtest/is_local.hpp -noinst_HEADERS+=libtest/killpid.h -noinst_HEADERS+=libtest/libtool.hpp -noinst_HEADERS+=libtest/memcached.h -noinst_HEADERS+=libtest/port.h -noinst_HEADERS+=libtest/runner.h -noinst_HEADERS+=libtest/server.h -noinst_HEADERS+=libtest/server_container.h -noinst_HEADERS+=libtest/signal.h -noinst_HEADERS+=libtest/socket.hpp -noinst_HEADERS+=libtest/stream.h -noinst_HEADERS+=libtest/strerror.h -noinst_HEADERS+=libtest/string.hpp -noinst_HEADERS+=libtest/test.h -noinst_HEADERS+=libtest/test.hpp -noinst_HEADERS+=libtest/tmpfile.hpp -noinst_HEADERS+=libtest/vchar.hpp -noinst_HEADERS+=libtest/visibility.h -noinst_HEADERS+=libtest/wait.h +noinst_HEADERS+= libtest/binaries.h +noinst_HEADERS+= libtest/cpu.hpp +noinst_HEADERS+= libtest/blobslap_worker.h +noinst_HEADERS+= libtest/callbacks.h +noinst_HEADERS+= libtest/cmdline.h +noinst_HEADERS+= libtest/collection.h +noinst_HEADERS+= libtest/common.h +noinst_HEADERS+= libtest/comparison.hpp +noinst_HEADERS+= libtest/core.h +noinst_HEADERS+= libtest/dream.h +noinst_HEADERS+= libtest/error.h +noinst_HEADERS+= libtest/failed.h +noinst_HEADERS+= libtest/fatal.hpp +noinst_HEADERS+= libtest/framework.h +noinst_HEADERS+= libtest/gearmand.h +noinst_HEADERS+= libtest/drizzled.h +noinst_HEADERS+= libtest/get.h +noinst_HEADERS+= libtest/has.hpp +noinst_HEADERS+= libtest/http.hpp +noinst_HEADERS+= libtest/is_pid.hpp +noinst_HEADERS+= libtest/is_local.hpp +noinst_HEADERS+= libtest/killpid.h +noinst_HEADERS+= libtest/libtool.hpp +noinst_HEADERS+= libtest/memcached.h +noinst_HEADERS+= libtest/port.h +noinst_HEADERS+= libtest/runner.h +noinst_HEADERS+= libtest/server.h +noinst_HEADERS+= libtest/server_container.h +noinst_HEADERS+= libtest/signal.h +noinst_HEADERS+= libtest/socket.hpp +noinst_HEADERS+= libtest/stream.h +noinst_HEADERS+= libtest/strerror.h +noinst_HEADERS+= libtest/string.hpp +noinst_HEADERS+= libtest/test.h +noinst_HEADERS+= libtest/test.hpp +noinst_HEADERS+= libtest/tmpfile.hpp +noinst_HEADERS+= libtest/vchar.hpp +noinst_HEADERS+= libtest/visibility.h +noinst_HEADERS+= libtest/wait.h noinst_LTLIBRARIES+= libtest/libtest.la @@ -236,9 +236,6 @@ libtest_skiptest_SOURCES= libtest/skiptest.cc check_PROGRAMS+= libtest/skiptest noinst_PROGRAMS+= libtest/skiptest -test-skip: libtest/skiptest - @libtest/skiptest - libtest_wait_SOURCES= libtest_wait_SOURCES+= libtest/wait.cc libtest_wait_SOURCES+= libtest/dream.cc diff --git a/libtest/memcached.cc b/libtest/memcached.cc index d17e5f51..adf650f8 100644 --- a/libtest/memcached.cc +++ b/libtest/memcached.cc @@ -375,8 +375,10 @@ bool Memcached::build(size_t argc, const char *argv[]) } add_option("-l", "localhost"); +#ifndef TARGET_OS_OSX add_option("-m", "128"); add_option("-M"); +#endif if (sasl()) { -- 2.30.2