From ee71b673a9ce3261cd81723262a8516949388be9 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Mon, 8 Aug 2011 20:50:35 -0700 Subject: [PATCH] Merge in version/etc libtest --- .bzrignore | 1 + configure.ac | 11 ++-- libtest/blobslap_worker.cc | 1 + libtest/cmdline.cc | 6 +- libtest/cmdline.h | 4 ++ libtest/common.h | 6 +- libtest/comparison.hpp | 26 ++++++-- libtest/gearmand.cc | 7 ++- libtest/gearmand.h | 6 +- libtest/include.am | 35 +++++++---- libtest/memcached.cc | 13 ++-- libtest/memcached.h | 6 +- libtest/server.cc | 118 +++++++++++++++++++++--------------- libtest/server.h | 5 ++ libtest/test.cc | 11 ++++ libtest/test.hpp | 1 + libtest/unittest.cc | 121 +++++++++++++++++++++++++++++++------ libtest/version.h.in | 34 +++++++++++ m4/libgearmand.m4 | 16 ----- 19 files changed, 310 insertions(+), 118 deletions(-) create mode 100644 libtest/version.h.in delete mode 100644 m4/libgearmand.m4 diff --git a/.bzrignore b/.bzrignore index 27188105..b0daef42 100644 --- a/.bzrignore +++ b/.bzrignore @@ -120,3 +120,4 @@ tests/testplus tests/testudp tests/var/ unittests/unittests +libtest/version.h diff --git a/configure.ac b/configure.ac index fcca1fd7..a71e3369 100644 --- a/configure.ac +++ b/configure.ac @@ -52,10 +52,12 @@ AC_SUBST(MEMCACHED_LIBRARY_VERSION) HASHKIT_LIBRARY_VERSION=1:0:0 AC_SUBST(HASHKIT_LIBRARY_VERSION) -AC_DEFINE([HAVE_LIBMEMCACHED], [ 1 ], [dummy rule for libtest]) -AC_SUBST(HAVE_LIBMEMCACHED, 1) -AM_CONDITIONAL(HAVE_LIBMEMCACHED, true) LT_INIT +AM_CONDITIONAL(BUILDING_LIBMEMCACHED, true) +AM_CONDITIONAL(HAVE_LIBMEMCACHED, false) + +AM_CONDITIONAL(BUILDING_GEARMAN, false) +AM_CONDITIONAL(HAVE_LIBGEARMAN, false) AC_SEARCH_LIBS(getopt_long, gnugetopt) AC_SEARCH_LIBS(gethostbyname, nsl) @@ -75,11 +77,9 @@ ENABLE_HSIEH_HASH ENABLE_MURMUR_HASH ENABLE_MEMASLAP PROTOCOL_BINARY_TEST -WITH_MEMCACHED ENABLE_DEPRECATED PANDORA_HAVE_LIBINNODB PANDORA_HAVE_SASL -WITH_LIBGEARMAN AC_CHECK_FUNCS([alarm]) AC_CHECK_FUNCS([dup2]) @@ -160,6 +160,7 @@ AC_CONFIG_FILES([ support/libmemcached.pc support/libmemcached.spec support/libmemcached-fc.spec + libtest/version.h ]) AC_OUTPUT diff --git a/libtest/blobslap_worker.cc b/libtest/blobslap_worker.cc index c7ac0a02..a12df583 100644 --- a/libtest/blobslap_worker.cc +++ b/libtest/blobslap_worker.cc @@ -21,6 +21,7 @@ #include + #include #include diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc index 6c71f9b0..b48d6917 100644 --- a/libtest/cmdline.cc +++ b/libtest/cmdline.cc @@ -21,14 +21,14 @@ #include -#include - using namespace libtest; #include #include #include +namespace libtest { + bool exec_cmdline(const std::string& executable, const char *args[]) { std::stringstream arg_buffer; @@ -63,3 +63,5 @@ bool exec_cmdline(const std::string& executable, const char *args[]) return true; } + +} // namespace exec_cmdline diff --git a/libtest/cmdline.h b/libtest/cmdline.h index cfe29575..0fcfe39c 100644 --- a/libtest/cmdline.h +++ b/libtest/cmdline.h @@ -21,4 +21,8 @@ #pragma once +namespace libtest { + bool exec_cmdline(const std::string& executable, const char *args[]); + +} diff --git a/libtest/common.h b/libtest/common.h index 7a7f1ff0..9963682e 100644 --- a/libtest/common.h +++ b/libtest/common.h @@ -20,7 +20,7 @@ */ /* - Common include file for libmemached + Common include file for libtest */ #pragma once @@ -53,4 +53,8 @@ #include #endif +#include +#include +#include + #include diff --git a/libtest/comparison.hpp b/libtest/comparison.hpp index 8656e499..6f7c5a5b 100644 --- a/libtest/comparison.hpp +++ b/libtest/comparison.hpp @@ -23,7 +23,14 @@ #include #include + +#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED #include +#endif + +#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN +#include +#endif namespace libtest { @@ -44,20 +51,31 @@ bool _compare(const char *file, int line, const char *func, T_comparable __expec { if (__expected != __actual) { - if (typeid(__expected) == typeid(memcached_return_t)) + if (typeid(__expected) == typeid(test_return_t)) + { + libtest::stream::make_cerr(file, line, func) << "Expected \"" + << test_strerror(test_return_t(__expected)) + << "\" got \"" + << test_strerror(test_return_t(__actual)) << "\""; + } +#if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED + else if (typeid(__expected) == typeid(memcached_return_t)) { libtest::stream::make_cerr(file, line, func) << "Expected \"" << memcached_strerror(NULL, memcached_return_t(__expected)) << "\" got \"" << memcached_strerror(NULL, memcached_return_t(__actual)) << "\""; } - else if (typeid(__expected) == typeid(test_return_t)) +#endif +#if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN + else if (typeid(__expected) == typeid(gearman_return_t)) { libtest::stream::make_cerr(file, line, func) << "Expected \"" - << test_strerror(test_return_t(__expected)) + << gearman_strerror(gearman_return_t(__expected)) << "\" got \"" - << test_strerror(test_return_t(__actual)) << "\""; + << gearman_strerror(gearman_return_t(__actual)) << "\""; } +#endif else { libtest::stream::make_cerr(file, line, func) << "Expected \"" << __expected << "\" got \"" << __actual << "\""; diff --git a/libtest/gearmand.cc b/libtest/gearmand.cc index 9a7649ef..6149b3c6 100644 --- a/libtest/gearmand.cc +++ b/libtest/gearmand.cc @@ -21,6 +21,7 @@ #include + #include #include "util/instance.hpp" @@ -83,12 +84,12 @@ public: using namespace libtest; -class Gearmand : public Server +class Gearmand : public libtest::Server { private: public: Gearmand(const std::string& host_arg, in_port_t port_arg) : - Server(host_arg, port_arg) + libtest::Server(host_arg, port_arg) { } pid_t get_pid(bool error_is_ok) @@ -208,7 +209,7 @@ bool Gearmand::build(int argc, const char *argv[]) namespace libtest { -Server *build_gearmand(const char *hostname, in_port_t try_port) +libtest::Server *build_gearmand(const char *hostname, in_port_t try_port) { return new Gearmand(hostname, try_port); } diff --git a/libtest/gearmand.h b/libtest/gearmand.h index 22aaa713..f6aa6c32 100644 --- a/libtest/gearmand.h +++ b/libtest/gearmand.h @@ -22,8 +22,12 @@ #pragma once +#include + +namespace libtest { class Server; } + namespace libtest { -Server *build_gearmand(const char *hostname, in_port_t try_port); +libtest::Server *build_gearmand(const char *hostname, in_port_t try_port); } diff --git a/libtest/include.am b/libtest/include.am index 2ed437c2..ab846b75 100644 --- a/libtest/include.am +++ b/libtest/include.am @@ -41,6 +41,10 @@ CLEANFILES+= \ tests/var/run/* \ tests/var/tmp/* +.PHONY: distclean-tests-check +distclean-tests-check: + -rm -rf tests/var + noinst_HEADERS+= \ libtest/blobslap_worker.h \ libtest/callbacks.h \ @@ -92,29 +96,41 @@ libtest_libtest_la_CXXFLAGS+= -DBUILDING_LIBTEST libtest_libtest_la_CXXFLAGS+= $(PTHREAD_CFLAGS) libtest_libtest_la_LIBADD= libtest_libtest_la_LIBADD+= $(PTHREAD_LIBS) +libtest_libtest_la_DEPENDENCIES= LIBTEST_LDADD= libtest/libtest.la -if HAVE_LIBMEMCACHED +# We are either building in tree, or with +if BUILDING_LIBMEMCACHED +libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcached.la +libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcachedutil.la libtest_libtest_la_LIBADD+= libmemcached/libmemcached.la libtest_libtest_la_LIBADD+= libmemcached/libmemcachedutil.la libtest_libtest_la_SOURCES+= libtest/memcached.cc endif +if HAVE_LIBMEMCACHED +libtest_libtest_la_LIBADD+= $(libmemcached_LIBS) -lmemcachedutil +libtest_libtest_la_SOURCES+= libtest/memcached.cc +endif +if BUILDING_GEARMAN +libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la +libtest_libtest_la_LIBADD+= libgearman/libgearman.la +libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc +libtest_libtest_la_SOURCES+= libtest/gearmand.cc +libtest_libtest_la_SOURCES+= util/instance.cc +libtest_libtest_la_SOURCES+= util/operation.cc +endif if HAVE_LIBGEARMAN -LIBTEST_LDADD+= libgearman/libgearman.la +libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la +libtest_libtest_la_LIBADD+= $(libgearman_LIBS) libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc libtest_libtest_la_SOURCES+= libtest/gearmand.cc libtest_libtest_la_SOURCES+= util/instance.cc libtest_libtest_la_SOURCES+= util/operation.cc endif -libtest_tmp_dir: tests/var/log tests/var/tmp tests/var/run clearn-var - -clearn-var: - @rm -f tests/var/log/* - @rm -f tests/var/run/* - @rm -f tests/var/tmp/* +libtest_tmp_dir: tests/var/log tests/var/tmp tests/var/run tests/var: @$(mkdir_p) tests/var @@ -128,8 +144,6 @@ tests/var/tmp: tests/var tests/var/run: tests/var @$(mkdir_p) tests/var/run -.PHONY+= tests/var - libtest_unittest_CFLAGS= libtest_unittest_LDADD= ${LIBTEST_LDADD} @@ -154,4 +168,3 @@ drd-unittest: libtest/unittest libtest_wait_SOURCES= libtest/wait.cc noinst_PROGRAMS+= libtest/wait - diff --git a/libtest/memcached.cc b/libtest/memcached.cc index 910ea809..1344c618 100644 --- a/libtest/memcached.cc +++ b/libtest/memcached.cc @@ -49,11 +49,11 @@ using namespace libtest; using namespace libtest; -class Memcached : public Server +class Memcached : public libtest::Server { public: Memcached(const std::string& host_arg, const in_port_t port_arg, const bool is_socket_arg) : - Server(host_arg, port_arg, is_socket_arg) + libtest::Server(host_arg, port_arg, is_socket_arg) { } pid_t get_pid(bool error_is_ok) @@ -161,6 +161,11 @@ public: return false; } + bool broken_socket_cleanup() + { + return true; + } + // Memcached's pidfile is broken bool broken_pid_file() { @@ -198,12 +203,12 @@ bool Memcached::build(int argc, const char *argv[]) namespace libtest { -Server *build_memcached(const std::string& hostname, const in_port_t try_port) +libtest::Server *build_memcached(const std::string& hostname, const in_port_t try_port) { return new Memcached(hostname, try_port, false); } -Server *build_memcached_socket(const std::string& hostname, const in_port_t try_port) +libtest::Server *build_memcached_socket(const std::string& hostname, const in_port_t try_port) { return new Memcached(hostname, try_port, true); } diff --git a/libtest/memcached.h b/libtest/memcached.h index 575ba001..58e1d79a 100644 --- a/libtest/memcached.h +++ b/libtest/memcached.h @@ -23,11 +23,9 @@ namespace libtest { -LIBTEST_API -Server *build_memcached(const std::string& hostname, const in_port_t try_port); +libtest::Server *build_memcached(const std::string& hostname, const in_port_t try_port); -LIBTEST_API -Server *build_memcached_socket(const std::string& socket_file, const in_port_t try_port); +libtest::Server *build_memcached_socket(const std::string& socket_file, const in_port_t try_port); } diff --git a/libtest/server.cc b/libtest/server.cc index b8fb603e..ee94c945 100644 --- a/libtest/server.cc +++ b/libtest/server.cc @@ -42,15 +42,6 @@ static inline std::string &rtrim(std::string &s) #include #include -#ifdef HAVE_LIBGEARMAN -#include -#include -#endif - -#ifdef HAVE_LIBMEMCACHED -#include -#endif - extern "C" { static bool exited_successfully(int status) { @@ -258,7 +249,7 @@ bool Server::set_socket_file() } else { - snprintf(file_buffer, sizeof(file_buffer), "tests/var/run/%s.socketXXXXXX", name()); + snprintf(file_buffer, sizeof(file_buffer), "var/run/%s.socketXXXXXX", name()); } int fd; @@ -286,7 +277,7 @@ bool Server::set_pid_file() } else { - snprintf(file_buffer, sizeof(file_buffer), "tests/var/run/%s.pidXXXXXX", name()); + snprintf(file_buffer, sizeof(file_buffer), "var/run/%s.pidXXXXXX", name()); } int fd; @@ -308,7 +299,7 @@ bool Server::set_log_file() char file_buffer[FILENAME_MAX]; file_buffer[0]= 0; - snprintf(file_buffer, sizeof(file_buffer), "tests/var/log/%s.logXXXXXX", name()); + snprintf(file_buffer, sizeof(file_buffer), "var/log/%s.logXXXXXX", name()); int fd; if ((fd= mkstemp(file_buffer)) == -1) { @@ -437,6 +428,11 @@ bool Server::kill(pid_t pid_arg) unlink(pid_file().c_str()); } + if (broken_socket_cleanup() and has_socket() and not socket().empty()) + { + unlink(socket().c_str()); + } + reset_pid(); return true; @@ -544,44 +540,62 @@ bool server_startup(server_startup_st& construct, const std::string& server_type } } - Server *server= NULL; + libtest::Server *server= NULL; if (0) { } else if (server_type.compare("gearmand") == 0) { -#ifdef GEARMAND_BINARY - #ifdef HAVE_LIBGEARMAN - server= build_gearmand("localhost", try_port); - #else - Error << "Libgearman was not found"; - #endif -#else - Error << "No gearmand binary is available"; -#endif + if (GEARMAND_BINARY) + { + if (HAVE_LIBGEARMAN) + { + server= build_gearmand("localhost", try_port); + } + else + { + Error << "Libgearman was not found"; + } + } + else + { + Error << "No gearmand binary is available"; + } } else if (server_type.compare("blobslap_worker") == 0) { -#ifdef GEARMAND_BINARY - #ifdef HAVE_LIBGEARMAN - server= build_blobslap_worker(try_port); - #else - Error << "Libgearman was not found"; - #endif -#else - Error << "No gearmand binary is available"; -#endif + if (GEARMAND_BINARY) + { + if (HAVE_LIBGEARMAN) + { + server= build_blobslap_worker(try_port); + } + else + { + Error << "Libgearman was not found"; + } + } + else + { + Error << "No gearmand binary is available"; + } } else if (server_type.compare("memcached") == 0) { -#ifdef MEMCACHED_BINARY -#ifdef HAVE_LIBMEMCACHED - server= build_memcached("localhost", try_port); -#else - Error << "Libmemcached was not found"; -#endif -#else - Error << "No memcached binary is available"; -#endif + if (MEMCACHED_BINARY) + { + if (HAVE_LIBMEMCACHED) + { + server= build_memcached("localhost", try_port); + } + else + { + Error << "Libmemcached was not found"; + } + } + else + { + Error << "No memcached binary is available"; + } } else { @@ -652,15 +666,21 @@ bool server_startup_st::start_socket_server(const std::string& server_type, cons } else if (server_type.compare("memcached") == 0) { -#ifdef MEMCACHED_BINARY -#ifdef HAVE_LIBMEMCACHED - server= build_memcached_socket("localhost", try_port); -#else - Error << "Libmemcached was not found"; -#endif -#else - Error << "No memcached binary is available"; -#endif + if (MEMCACHED_BINARY) + { + if (HAVE_LIBMEMCACHED) + { + server= build_memcached_socket("localhost", try_port); + } + else + { + Error << "Libmemcached was not found"; + } + } + else + { + Error << "No memcached binary is available"; + } } else { diff --git a/libtest/server.h b/libtest/server.h index a38bf428..01b2ce9a 100644 --- a/libtest/server.h +++ b/libtest/server.h @@ -60,6 +60,11 @@ public: virtual const char *log_file_option()= 0; virtual bool is_libtool()= 0; + virtual bool broken_socket_cleanup() + { + return false; + } + virtual const char *socket_file_option() const { return NULL; diff --git a/libtest/test.cc b/libtest/test.cc index 1ed61578..7b13ab79 100644 --- a/libtest/test.cc +++ b/libtest/test.cc @@ -149,6 +149,17 @@ int main(int argc, char *argv[]) { srandom((unsigned int)time(NULL)); + if (getenv("srcdir")) + { + char buffer[1024]; + snprintf(buffer, sizeof(buffer), "%s/%s", getenv("srcdir"), "tests"); + chdir(buffer); + } + else + { + chdir("tests"); + } + world= new Framework(); if (not world) diff --git a/libtest/test.hpp b/libtest/test.hpp index 3e834b02..1933ef4b 100644 --- a/libtest/test.hpp +++ b/libtest/test.hpp @@ -30,6 +30,7 @@ #include #include +#include #include #include diff --git a/libtest/unittest.cc b/libtest/unittest.cc index e3272783..6fcc5cff 100644 --- a/libtest/unittest.cc +++ b/libtest/unittest.cc @@ -113,6 +113,73 @@ static test_return_t local_not_test(void *) return TEST_SUCCESS; } +static test_return_t var_exists_test(void *) +{ + test_compare(0, access("var", R_OK | W_OK | X_OK)); + return TEST_SUCCESS; +} + +static test_return_t var_tmp_exists_test(void *) +{ + test_compare(0, access("var/tmp", R_OK | W_OK | X_OK)); + return TEST_SUCCESS; +} + +static test_return_t var_run_exists_test(void *) +{ + test_compare(0, access("var/run", R_OK | W_OK | X_OK)); + return TEST_SUCCESS; +} + +static test_return_t var_log_exists_test(void *) +{ + test_compare(0, access("var/log", R_OK | W_OK | X_OK)); + return TEST_SUCCESS; +} + +static test_return_t var_tmp_test(void *) +{ + FILE *file= fopen("var/tmp/junk", "w+"); + test_true(file); + fclose(file); + return TEST_SUCCESS; +} + +static test_return_t var_run_test(void *) +{ + FILE *file= fopen("var/run/junk", "w+"); + test_true(file); + fclose(file); + return TEST_SUCCESS; +} + +static test_return_t var_log_test(void *) +{ + FILE *file= fopen("var/log/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_run_rm_test(void *) +{ + test_true(unlink("var/run/junk") == 0); + return TEST_SUCCESS; +} + +static test_return_t var_log_rm_test(void *) +{ + test_true(unlink("var/log/junk") == 0); + return TEST_SUCCESS; +} + + #if 0 static test_return_t pause_test(void *) { @@ -127,14 +194,15 @@ static test_return_t gearmand_cycle_test(void *object) server_startup_st *servers= (server_startup_st*)object; test_true(servers); -#ifndef HAVE_LIBGEARMAN - return TEST_SKIPPED; -#endif + if (HAVE_LIBGEARMAN) + { + const char *argv[1]= { "cycle_gearmand" }; + test_true(server_startup(*servers, "gearmand", 9999, 1, argv)); - const char *argv[1]= { "cycle_gearmand" }; - test_true(server_startup(*servers, "gearmand", 9999, 1, argv)); + return TEST_SUCCESS; + } - return TEST_SUCCESS; + return TEST_SKIPPED; } static test_return_t memcached_cycle_test(void *object) @@ -142,14 +210,15 @@ static test_return_t memcached_cycle_test(void *object) server_startup_st *servers= (server_startup_st*)object; test_true(servers); -#if !defined(MEMCACHED_BINARY) || !defined(HAVE_LIBMEMCACHED) - return TEST_SKIPPED; -#endif + if (MEMCACHED_BINARY and HAVE_LIBMEMCACHED) + { + const char *argv[1]= { "cycle_memcached" }; + test_true(server_startup(*servers, "memcached", 9998, 1, argv)); - const char *argv[1]= { "cycle_memcached" }; - test_true(server_startup(*servers, "memcached", 9998, 1, argv)); + return TEST_SUCCESS; + } - return TEST_SUCCESS; + return TEST_SKIPPED; } static test_return_t memcached_socket_cycle_test(void *object) @@ -157,14 +226,15 @@ static test_return_t memcached_socket_cycle_test(void *object) server_startup_st *servers= (server_startup_st*)object; test_true(servers); -#if !defined(MEMCACHED_BINARY) || !defined(HAVE_LIBMEMCACHED) - return TEST_SKIPPED; -#endif + if (MEMCACHED_BINARY and HAVE_LIBMEMCACHED) + { + const char *argv[1]= { "cycle_memcached" }; + test_true(servers->start_socket_server("memcached", 9997, 1, argv)); - const char *argv[1]= { "cycle_memcached" }; - test_true(servers->start_socket_server("memcached", 9997, 1, argv)); + return TEST_SUCCESS; + } - return TEST_SUCCESS; + return TEST_SKIPPED; } test_st gearmand_tests[] ={ @@ -201,10 +271,25 @@ test_st local_log[] ={ {0, 0, 0} }; +test_st directories_tests[] ={ + {"var exists", 0, var_exists_test }, + {"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/tmp", 0, var_tmp_test }, + {"var/run", 0, var_run_test }, + {"var/log", 0, var_log_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 }, + {0, 0, 0} +}; + collection_st collection[] ={ {"environment", 0, 0, environment_tests}, {"return values", 0, 0, tests_log}, {"local", 0, 0, local_log}, + {"directories", 0, 0, directories_tests}, {"gearmand", 0, 0, gearmand_tests}, {"memcached", 0, 0, memcached_tests}, {0, 0, 0, 0} diff --git a/libtest/version.h.in b/libtest/version.h.in new file mode 100644 index 00000000..16c4656b --- /dev/null +++ b/libtest/version.h.in @@ -0,0 +1,34 @@ +/* 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 + */ + + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#define LIBTEST_VERSION_STRING "@VERSION@" +#define LIBTEST_VERSION_HEX @HEX_VERSION@ + +#ifdef __cplusplus +} +#endif diff --git a/m4/libgearmand.m4 b/m4/libgearmand.m4 deleted file mode 100644 index c90d02f3..00000000 --- a/m4/libgearmand.m4 +++ /dev/null @@ -1,16 +0,0 @@ -AC_DEFUN([_WITH_LIBGEARMAN], - [ AC_ARG_ENABLE([libgearman], - [AS_HELP_STRING([--disable-libgearman], - [Build with libgearman support @<:@default=on@:>@])], - [ac_enable_libgearman="$enableval"], - [ac_enable_libgearman="yes"]) - - AS_IF([test "x$ac_enable_libgearman" = "xyes"], - [ PKG_CHECK_MODULES([libgearman], [ libgearman >= 0.24 ], - [AC_DEFINE([HAVE_LIBGEARMAN], [ 1 ], [Enable libgearman support])], - [ac_enable_libgearman="no"] )]) - - AM_CONDITIONAL(HAVE_LIBGEARMAN, test "x${ac_enable_libgearman}" = "xyes") - ]) - -AC_DEFUN([WITH_LIBGEARMAN], [ AC_REQUIRE([_WITH_LIBGEARMAN]) ]) -- 2.30.2