Browse Source

Update tests, remove the need for external testing of gearmand options.

Brian Aker 13 years ago
parent
commit
4974f8a379
10 changed files with 461 additions and 119 deletions
  1. 1 0
      .bzrignore
  2. 0 36
      gearmand/include.am
  3. 21 4
      libtest/test.cc
  4. 15 4
      tests/drizzle_test.cc
  5. 374 0
      tests/gearmand.cc
  6. 0 14
      tests/httpd.am
  7. 9 4
      tests/include.am
  8. 1 21
      tests/libmemcached.am
  9. 32 7
      tests/memcached_test.cc
  10. 8 29
      tests/sqlite.am

+ 1 - 0
.bzrignore

@@ -95,6 +95,7 @@ tests/drizzle_test
 tests/gearadmin
 tests/gearman.pi*
 tests/gearman.sql
+tests/gearmand
 tests/gearmand.log*
 tests/internals_test
 tests/memcached_test

+ 0 - 36
gearmand/include.am

@@ -34,39 +34,3 @@ gearmand-valgrind: gearmand/gearmand
 
 gearmand-debug: gearmand/gearmand
 	$(LIBTOOL) --mode=execute gdb gearmand/gearmand
-
-gearmand-test-args: gearmand/gearmand
-	@gearmand/gearmand --check-args
-	@gearmand/gearmand --backlog=10 --check-args
-	@gearmand/gearmand --b 10 --check-args
-	@gearmand/gearmand --d --check-args
-	@gearmand/gearmand --daemon --check-args
-	@gearmand/gearmand --file-descriptors=100 --check-args
-	@gearmand/gearmand --f 100 --check-args
-	@gearmand/gearmand -h --check-args
-	@gearmand/gearmand --help --check-args
-	@gearmand/gearmand -l "tmp/foo" --check-args
-	@gearmand/gearmand --log-file="tmp/foo" --check-args
-	@gearmand/gearmand --listen=10 --check-args
-	@gearmand/gearmand -L 10 --check-args
-	@gearmand/gearmand --port=10 --check-args
-	@gearmand/gearmand -p 10 --check-args
-	@gearmand/gearmand --pid-file="tmp/file.pid" --check-args
-	@gearmand/gearmand -P "tmp/file.pid" --check-args
-	@gearmand/gearmand --round-robin --check-args
-	@gearmand/gearmand -R --check-args
-	@gearmand/gearmand --pid-file="tmp/file.pid" --check-args
-	@gearmand/gearmand -P "tmp/file.pid" --check-args
-	@gearmand/gearmand --threads=10 --check-args
-	@gearmand/gearmand -t 10  --check-args
-	@gearmand/gearmand --user=nobody --check-args
-	@gearmand/gearmand -u nobody --check-args
-	@gearmand/gearmand --check-args -vvvv
-	@gearmand/gearmand -V --check-args
-	@gearmand/gearmand --version --check-args
-	@gearmand/gearmand -w 10 --check-args
-	@gearmand/gearmand --worker-wakeup=10 --check-args
-	@gearmand/gearmand --protocol=http --check-args
-	@gearmand/gearmand --queue-type=http --check-args
-	@gearmand/gearmand -j 10 --check-args
-	@gearmand/gearmand --job-retries=10 --check-args

+ 21 - 4
libtest/test.cc

@@ -94,6 +94,11 @@ void set_default_socket(const char *socket)
 
 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;
@@ -179,9 +184,21 @@ int main(int argc, char *argv[])
 
   test_return_t error;
   void *creators_ptr= world->create(error);
-  if (test_failed(error))
+
+  switch (error)
   {
-    Error << "create() failed";
+  case TEST_SUCCESS:
+    break;
+
+  case TEST_SKIPPED:
+    Out << "SKIP " << argv[0];
+    delete world;
+    return EXIT_SUCCESS;
+
+  case TEST_FATAL:
+  case TEST_FAILURE:
+  case TEST_MEMORY_ALLOCATION_FAILURE:
+    Error << argv[0] << "create() failed";
     delete world;
     return EXIT_FAILURE;
   }
@@ -368,11 +385,11 @@ cleanup:
     Out << "Some test failed.";
     exit_code= EXIT_FAILURE;
   }
-  else if (stats.collection_skipped)
+  else if (stats.collection_skipped and stats.collection_failed and stats.collection_success)
   {
     Out << "Some tests were skipped.";
   }
-  else
+  else if (stats.collection_success and stats.collection_failed == 0)
   {
     Out << "All tests completed successfully.";
   }

+ 15 - 4
tests/drizzle_test.cc

@@ -30,6 +30,16 @@ using namespace libtest;
 #pragma GCC diagnostic ignored "-Wold-style-cast"
 #endif
 
+static test_return_t test_for_HAVE_LIBDRIZZLE(void *)
+{
+#ifdef HAVE_LIBDRIZZLE
+  return TEST_SUCCESS;
+#else
+  return TEST_SKIPPED;
+#endif
+}
+
+
 static test_return_t collection_init(void *object)
 {
   Context *test= (Context *)object;
@@ -53,8 +63,11 @@ static test_return_t collection_cleanup(void *object)
 
 static void *world_create(server_startup_st& servers, test_return_t& error)
 {
-  (void)collection_init;
-  (void)collection_cleanup;
+  if (test_for_HAVE_LIBDRIZZLE(NULL) == TEST_SKIPPED)
+  {
+    error= TEST_SKIPPED;
+    return NULL;
+  }
 
   Context *test= new Context(DRIZZLE_TEST_PORT, servers);
   if (not test)
@@ -93,10 +106,8 @@ test_st regressions[] ={
 };
 
 collection_st collection[] ={
-#ifdef HAVE_LIBDRIZZLE
   {"drizzle queue", collection_init, collection_cleanup, tests},
   {"regressions", collection_init, collection_cleanup, regressions},
-#endif
   {0, 0, 0, 0}
 };
 

+ 374 - 0
tests/gearmand.cc

@@ -0,0 +1,374 @@
+/*  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ * 
+ *  Cycle the Gearmand server
+ *
+ *  Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ *
+ *  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.
+ *
+ */
+
+
+/*
+  Test that we are cycling the servers we are creating during testing.
+*/
+
+#include <config.h>
+
+#include <libtest/test.hpp>
+
+using namespace libtest;
+
+#ifndef __INTEL_COMPILER
+#pragma GCC diagnostic ignored "-Wstrict-aliasing"
+#endif
+
+#include "tests/ports.h"
+
+static std::string executable;
+
+static test_return_t check_args_test(void *)
+{
+  const char *args[]= { "--check-args", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_backlog_test(void *)
+{
+  const char *args[]= { "--check-args", "--backlog=10", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_backlog_test(void *)
+{
+  const char *args[]= { "--check-args", "-b 10", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_daemon_test(void *)
+{
+  const char *args[]= { "--check-args", "--daemon", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_daemon_test(void *)
+{
+  const char *args[]= { "--check-args", "-d", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_file_descriptors_test(void *)
+{
+  const char *args[]= { "--check-args", "--file-descriptors", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_file_descriptors_test(void *)
+{
+  const char *args[]= { "--check-args", "-f", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_help_test(void *)
+{
+  const char *args[]= { "--check-args", "--help", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_help_test(void *)
+{
+  const char *args[]= { "--check-args", "-h", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_log_file_test(void *)
+{
+  const char *args[]= { "--check-args", "--log-file=\"tmp/foo\"", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_log_file_test(void *)
+{
+  const char *args[]= { "--check-args", "-l \"tmp/foo\"", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_listen_test(void *)
+{
+  const char *args[]= { "--check-args", "--listen=10", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_listen_test(void *)
+{
+  const char *args[]= { "--check-args", "-L 10", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_port_test(void *)
+{
+  const char *args[]= { "--check-args", "--port=10", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_port_test(void *)
+{
+  const char *args[]= { "--check-args", "-p 10", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_pid_file_test(void *)
+{
+  const char *args[]= { "--check-args", "--pid-file=\"tmp/gearmand.pid\"", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_pid_file_test(void *)
+{
+  const char *args[]= { "--check-args", "-P \"tmp/gearmand.pid\"", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_round_robin_test(void *)
+{
+  const char *args[]= { "--check-args", "--round-robin", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_round_robin_test(void *)
+{
+  const char *args[]= { "--check-args", "-R", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_threads_test(void *)
+{
+  const char *args[]= { "--check-args", "--threads=10", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_threads_test(void *)
+{
+  const char *args[]= { "--check-args", "-T 8", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_user_test(void *)
+{
+  const char *args[]= { "--check-args", "--user=nobody", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_user_test(void *)
+{
+  const char *args[]= { "--check-args", "-u nobody", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_version_test(void *)
+{
+  const char *args[]= { "--check-args", "--version", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_version_test(void *)
+{
+  const char *args[]= { "--check-args", "-V", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t verbose_test(void *)
+{
+  const char *args[]= { "--check-args", "-vvv", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_worker_wakeup_test(void *)
+{
+  const char *args[]= { "--check-args", "--worker_wakeup", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_worker_wakeup_test(void *)
+{
+  const char *args[]= { "--check-args", "-V", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t protocol_test(void *)
+{
+  const char *args[]= { "--check-args", "--protocol=http", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t queue_test(void *)
+{
+  const char *args[]= { "--check-args", "--queue=builtin", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t long_job_retries_test(void *)
+{
+  const char *args[]= { "--check-args", "--job_retries", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t short_job_retries_test(void *)
+{
+  const char *args[]= { "--check-args", "-j", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+static test_return_t http_port_test(void *)
+{
+  const char *args[]= { "--check-args", "--protocol=http", "--http-port=8090",  0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
+
+
+test_st gearmand_option_tests[] ={
+  {"--check-args", 0, check_args_test},
+  {"--backlog=", 0, long_backlog_test},
+  {"-b", 0, short_backlog_test},
+  {"--daemon", 0, long_daemon_test},
+  {"-d", 0, short_daemon_test},
+  {"--file-descriptors=", 0, long_file_descriptors_test},
+  {"-f", 0, short_file_descriptors_test},
+  {"--help", 0, long_help_test},
+  {"-h", 0, short_help_test},
+  {"--log-file=", 0, long_log_file_test},
+  {"-l", 0, short_log_file_test},
+  {"--listen=", 0, long_listen_test},
+  {"-L", 0, short_listen_test},
+  {"--port=", 0, long_port_test},
+  {"-p", 0, short_port_test},
+  {"--pid-file=", 0, long_pid_file_test},
+  {"-P", 0, short_pid_file_test},
+  {"--round-robin", 0, long_round_robin_test},
+  {"-R", 0, short_round_robin_test},
+  {"--threads=", 0, long_threads_test},
+  {"-T", 0, short_threads_test},
+  {"--user=", 0, long_user_test},
+  {"-u", 0, short_user_test},
+  {"--user=", 0, long_user_test},
+  {"-u", 0, short_user_test},
+  {"-vvv", 0, verbose_test},
+  {"--version", 0, long_version_test},
+  {"-V", 0, short_version_test},
+  {"--worker_wakeup=", 0, long_worker_wakeup_test},
+  {"-w", 0, short_worker_wakeup_test},
+  {"--protocol=", 0, protocol_test},
+  {"--queue=", 0, queue_test},
+  {"--job-retries=", 0, long_job_retries_test},
+  {"-j", 0, short_job_retries_test},
+  {0, 0, 0}
+};
+
+test_st gearmand_httpd_option_tests[] ={
+  {"--http-port=", 0, http_port_test},
+  {0, 0, 0}
+};
+
+collection_st collection[] ={
+  {"basic options", 0, 0, gearmand_option_tests},
+  {"httpd options", 0, 0, gearmand_httpd_option_tests},
+  {0, 0, 0, 0}
+};
+
+void get_world(Framework *world)
+{
+  world->collections= collection;
+}
+

+ 0 - 14
tests/httpd.am

@@ -1,14 +0,0 @@
-# vim:ft=automake
-# Gearman server and library
-# Copyright (C) 2011 Data Differential, http://datadifferential.com/
-# All rights reserved.
-#
-# Use and distribution licensed under the BSD license.  See
-# the COPYING file in the parent directory for full text.
-#
-# Included from Top Level Makefile.am
-# All paths should be given relative to the root
-#
-
-tests-httpd-args: gearmand/gearmand
-	@gearmand/gearmand --http-port=80

+ 9 - 4
tests/include.am

@@ -71,6 +71,11 @@ tests_gearadmin_LDADD= ${CLIENT_LDADD}
 check_PROGRAMS+= tests/gearadmin
 noinst_PROGRAMS+= tests/gearadmin
 
+tests_gearmand_SOURCES= tests/gearmand.cc
+tests_gearmand_LDADD= ${CLIENT_LDADD}
+check_PROGRAMS+= tests/gearmand
+noinst_PROGRAMS+= tests/gearmand
+
 tests_blobslap_client_SOURCES= tests/blobslap_client.cc
 tests_blobslap_client_LDADD= ${CLIENT_LDADD}
 #check_PROGRAMS+= tests/blobslap_client
@@ -118,6 +123,9 @@ test-cycle: tests/cycle
 test-gearadmin: tests/gearadmin
 	@tests/gearadmin
 
+test-gearmand: tests/gearmand
+	@tests/gearmand
+
 tests-blobslap_client: tests/blobslap_client
 	@tests/blobslap_client
 
@@ -133,9 +141,7 @@ test-worker: tests/worker_test
 test-internals: tests/internals_test
 	@tests/internals_test
 
-check-local: gearmand-test-args client-test libtest-tests
-
-libtest-tests: test-client test-round-robin test-worker test-internals test-libmemcached test-sqlite test-tokyocabinet test-burnin
+check-local: client-test
 
 gdb-client:
 	@$(GDB_COMMAND) tests/client_test
@@ -212,7 +218,6 @@ drd-cycle: tests/cycle
 
 helgrind: ${noinst_PROGRAMS} helgrind-gearadmin helgrind-cycle helgrind-client helgrind-round-robin helgrind-worker helgrind-internals helgrind-sqlite helgrind-tokyocabinet helgrind-burnin
 
-include tests/httpd.am
 include tests/libdrizzle.am
 include tests/libmemcached.am
 include tests/postgres.am

+ 1 - 21
tests/libmemcached.am

@@ -10,37 +10,17 @@
 # All paths should be given relative to the root
 #
 
-test-libmemcached: tests-libmemcached-args test-libmemcached-queue 
-
-tests-libmemcached-args: gearmand/gearmand
-if HAVE_LIBMEMCACHED
-	@gearmand/gearmand --check-args --queue=libmemcached --libmemcached-servers=localhost:12555
-endif
-
 tests_memcached_test_SOURCES= \
 			      tests/basic.cc \
 			      tests/memcached_test.cc
 tests_memcached_test_LDADD= ${CLIENT_LDADD}
 tests_memcached_test_CXXFLAGS= ${AM_CXXFLAGS}
 noinst_PROGRAMS += tests/memcached_test
-
-if HAVE_LIBMEMCACHED
-if HAVE_MEMCACHED
 check_PROGRAMS += tests/memcached_test
-endif
-endif
 
 
-test-libmemcached-queue:
-if HAVE_LIBMEMCACHED
-if HAVE_MEMCACHED
+test-libmemcached:
 	@tests/memcached_test  
-endif
-endif
 
 valgrind-libmemcached:
-if HAVE_LIBMEMCACHED
-if HAVE_MEMCACHED
 	@tests/memcached_test  
-endif
-endif

+ 32 - 7
tests/memcached_test.cc

@@ -26,13 +26,29 @@ using namespace libtest;
 
 #ifndef __INTEL_COMPILER
 #pragma GCC diagnostic ignored "-Wold-style-cast"
+
 #endif
 
-// prototype
-test_return_t collection_init(void *object);
-test_return_t collection_cleanup(void *object);
+static bool test_for_HAVE_LIBMEMCACHED(test_return_t &error)
+{
+#ifdef test_for_HAVE_LIBMEMCACHED
+  error= TEST_SUCCESS;
+  return true;
+#else
+  error= TEST_SKIPPED;
+  return false;
+#endif
+}
+
+static test_return_t gearmand_basic_option_test(void *)
+{
+  const char *args[]= { "--queue=libmemcached",  "--libmemcached-servers=localhost:12555", "--check-args", 0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
 
-test_return_t collection_init(void *object)
+static test_return_t collection_init(void *object)
 {
   const char *argv[3]= { "test_gearmand", "--libmemcached-servers=localhost:12555", "--queue-type=libmemcached" };
 
@@ -44,7 +60,7 @@ test_return_t collection_init(void *object)
   return TEST_SUCCESS;
 }
 
-test_return_t collection_cleanup(void *object)
+static test_return_t collection_cleanup(void *object)
 {
   Context *test= (Context *)object;
   test->reset();
@@ -55,6 +71,11 @@ test_return_t collection_cleanup(void *object)
 
 static void *world_create(server_startup_st& servers, test_return_t& error)
 {
+  if (not test_for_HAVE_LIBMEMCACHED(error))
+  {
+    return NULL;
+  }
+
   if (not server_startup(servers, "memcached", 12555, 0, NULL))
   {
     error= TEST_FAILURE;
@@ -80,6 +101,11 @@ static bool world_destroy(void *object)
   return TEST_SUCCESS;
 }
 
+test_st gearmand_basic_option_tests[] ={
+  {"--queue=libmemcached --libmemcached-servers=", 0, gearmand_basic_option_test },
+  {0, 0, 0}
+};
+
 test_st tests[] ={
   {"gearman_client_echo()", 0, client_echo_test },
   {"gearman_client_echo() fail", 0, client_echo_fail_test },
@@ -91,9 +117,8 @@ test_st tests[] ={
 };
 
 collection_st collection[] ={
-#ifdef HAVE_LIBMEMCACHED
+  {"gearmand options", 0, 0, gearmand_basic_option_tests},
   {"memcached queue", collection_init, collection_cleanup, tests},
-#endif
   {0, 0, 0, 0}
 };
 

+ 8 - 29
tests/sqlite.am

@@ -10,44 +10,23 @@
 # All paths should be given relative to the root
 #
 
-test-sqlite: tests/sqlite_test tests-sqlite-args test-sqlite-queue
-
-tests-sqlite-args: gearmand/gearmand
-if HAVE_LIBSQLITE3
-	@gearmand/gearmand --check-args --libsqlite3-db=tmp/schema --libsqlite3-table=tmp/table
-endif
-
-if HAVE_LIBSQLITE3
-SQLITE_TEST= tests/sqlite_test
 CLEANFILES+= tests/gearman.sql tests/gearman.sql-journal tests/gearmand.log*
-noinst_PROGRAMS+= tests/sqlite_test
-endif
 
 tests_sqlite_test_SOURCES= \
 			   tests/basic.cc \
 			   tests/sqlite_test.cc
 tests_sqlite_test_LDADD= ${CLIENT_LDADD}
+noinst_PROGRAMS+= tests/sqlite_test
 check_PROGRAMS+= tests/sqlite_test
 
-sqlite-nuke: 
-	@rm -f tests/var/gearmand.log*
-
-test-sqlite-queue: tests/sqlite_test sqlite-nuke
-if HAVE_LIBSQLITE3
-	$(SQLITE_TEST)
-endif
+tests-sqlite: tests/sqlite_test
+	@tests/sqlite_test
 
-gdb-sqlite: tests/sqlite_test sqlite-nuke
-if HAVE_LIBSQLITE3
+gdb-sqlite: tests/sqlite_test
 	@$(GDB_COMMAND) tests/sqlite_test
-endif
 
-helgrind-sqlite: tests/sqlite_test sqlite-nuke
-if HAVE_LIBSQLITE3
-	$(HELGRIND_COMMAND) $(SQLITE_TEST)
-endif
+helgrind-sqlite: tests/sqlite_test
+	@$(HELGRIND_COMMAND) tests/sqlite_test
 
-valgrind-sqlite: tests/sqlite_test sqlite-nuke
-if HAVE_LIBSQLITE3
-	$(VALGRIND_COMMAND) $(SQLITE_TEST)
-endif
+valgrind-sqlite: tests/sqlite_test
+	@$(VALGRIND_COMMAND) tests/sqlite_test

Some files were not shown because too many files changed in this diff