Browse Source

Cleanups around testing, place all of the option processing in the tests.

Brian Aker 13 years ago
parent
commit
0f7da2939e
4 changed files with 35 additions and 23 deletions
  1. 21 0
      tests/drizzle_test.cc
  2. 9 9
      tests/include.am
  3. 2 14
      tests/libdrizzle.am
  4. 3 0
      tests/tokyocabinet.am

+ 21 - 0
tests/drizzle_test.cc

@@ -39,6 +39,22 @@ static test_return_t test_for_HAVE_LIBDRIZZLE(void *)
 #endif
 }
 
+static test_return_t gearmand_basic_option_test(void *)
+{
+  const char *args[]= { "--check-args", 
+    "--libdrizzle-host=localhost",
+    "--libdrizzle-port=90",
+    "--libdrizzle-uds=tmp/foo.socket",
+    "--libdrizzle-user=root",
+    "--libdrizzle-password=test",
+    "--libdrizzle-db=gearman",
+    "--libdrizzle-table=gearman",
+    "--libdrizzle-mysql",
+    0 };
+
+  test_success(exec_cmdline(GEARMAND_BINARY, args));
+  return TEST_SUCCESS;
+}
 
 static test_return_t collection_init(void *object)
 {
@@ -90,6 +106,11 @@ static bool world_destroy(void *object)
   return TEST_SUCCESS;
 }
 
+test_st gearmand_basic_option_tests[] ={
+  {"all options", 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 },

+ 9 - 9
tests/include.am

@@ -143,10 +143,10 @@ test-internals: tests/internals_test
 
 check-local: client-test
 
-gdb-client:
+gdb-client: tests/client_test
 	@$(GDB_COMMAND) tests/client_test
 
-gdb-round-robin:
+gdb-round-robin: tests/round_robin_test
 	@$(GDB_COMMAND) tests/round_robin_test
 
 gdb-worker: tests/worker_test
@@ -167,12 +167,12 @@ gdb-blobslap_client: tests/blobslap_client
 gdb-cycle: tests/cycle
 	@$(GDB_COMMAND) tests/cycle
 
-gdb-all: ${noinst_PROGRAMS} gdb-gearadmin gdb-cycle gdb-client gdb-round-robin gdb-worker gdb-internals gdb-sqlite gdb-tokyocabinet gdb-burnin
+gdb-all: gdb-gearadmin gdb-cycle gdb-client gdb-round-robin gdb-worker gdb-internals gdb-sqlite gdb-tokyocabinet gdb-burnin
 
-valgrind-client:
+valgrind-client: tests/client_test
 	@$(VALGRIND_COMMAND) tests/client_test
 
-valgrind-round-robin:
+valgrind-round-robin: tests/round_robin_test
 	@$(VALGRIND_COMMAND) tests/round_robin_test
 
 valgrind-worker: tests/worker_test
@@ -190,12 +190,12 @@ valgrind-gearadmin: tests/gearadmin
 valgrind-cycle: tests/cycle
 	@$(VALGRIND_COMMAND) tests/cycle
 
-valgrind: ${noinst_PROGRAMS} valgrind-gearadmin valgrind-cycle valgrind-client valgrind-round-robin valgrind-worker valgrind-internals valgrind-sqlite valgrind-tokyocabinet valgrind-burnin
+valgrind: valgrind-unittest valgrind-gearadmin valgrind-cycle valgrind-client valgrind-round-robin valgrind-worker valgrind-internals valgrind-sqlite valgrind-tokyocabinet valgrind-burnin
 
-helgrind-client:
+helgrind-client: tests/client_test
 	@$(HELGRIND_COMMAND) tests/client_test
 
-helgrind-round-robin:
+helgrind-round-robin: tests/round_robin_test
 	@$(HELGRIND_COMMAND) tests/round_robin_test
 
 helgrind-worker: tests/worker_test
@@ -216,7 +216,7 @@ helgrind-cycle: tests/cycle
 drd-cycle: tests/cycle
 	@$(DRD_COMMAND) tests/cycle
 
-helgrind: ${noinst_PROGRAMS} helgrind-gearadmin helgrind-cycle helgrind-client helgrind-round-robin helgrind-worker helgrind-internals helgrind-sqlite helgrind-tokyocabinet helgrind-burnin
+helgrind: helgrind-gearadmin helgrind-cycle helgrind-client helgrind-round-robin helgrind-worker helgrind-internals helgrind-sqlite helgrind-tokyocabinet helgrind-burnin
 
 include tests/libdrizzle.am
 include tests/libmemcached.am

+ 2 - 14
tests/libdrizzle.am

@@ -10,24 +10,12 @@
 # All paths should be given relative to the root
 #
 
-test-drizzle: test-libdrizzle-args test-drizzle-queue
-
-tests-libdrizzle-args: gearmand/gearmand
-if HAVE_LIBDRIZZLE
-	@gearmand/gearmand --check-args --libdrizzle-host=localhost --libdrizzle-port=90 --libdrizzle-uds=tmp/foo.socket --libdrizzle-user=root --libdrizzle-password=test --libdrizzle-db=gearman --libdrizzle-table=gearman --libdrizzle-mysql
-endif
-
-test-drizzle-queue: gearmand/gearmand
-if HAVE_LIBDRIZZLE
+test-drizzle: tests/drizzle_test
 	@tests/drizzle_test
-endif
-
-if HAVE_LIBDRIZZLE
-DRIZZLE_TEST= tests/drizzle_test
-endif
 
 tests_drizzle_test_SOURCES= \
 			    tests/basic.cc \
 			    tests/drizzle_test.cc
 tests_drizzle_test_LDADD= ${CLIENT_LDADD}
 noinst_PROGRAMS+= tests/drizzle_test
+check_PROGRAMS += tests/drizzle_test

+ 3 - 0
tests/tokyocabinet.am

@@ -17,3 +17,6 @@ check_PROGRAMS+= tests/tokyocabinet_test
 
 test-tokyocabinet: tests/tokyocabinet_test
 	@tests/tokyocabinet_test
+
+valgrind-tokyocabinet:
+	@$(VALGRIND_COMMAND) tests/tokyocabinet_test