Merge working tree with build tree.
[m6w6/libmemcached] / libtest / blobslap_worker.cc
index 378f82688f4510187e3fdbf39410751d83c2c903..f341962061da1a4a17855bc4baaa2ae3856d481a 100644 (file)
  */
 
 
+#include <config.h>
 #include <libtest/common.h>
 
 #include <libtest/blobslap_worker.h>
-#include <libtest/killpid.h>
-
-using namespace libtest;
 
 #include <cassert>
 #include <cerrno>
@@ -44,14 +42,14 @@ using namespace libtest;
 #pragma GCC diagnostic ignored "-Wold-style-cast"
 #endif
 
-using namespace libtest;
+namespace libtest {
 
 class BlobslapWorker : public Server
 {
 private:
 public:
   BlobslapWorker(in_port_t port_arg) :
-    Server("localhost", port_arg)
+    Server("localhost", port_arg, "benchmark/blobslap_worker", true)
   { 
     set_pid_file();
   }
@@ -120,29 +118,14 @@ public:
     return "blobslap_worker";
   };
 
-  const char *executable()
-  {
-    return GEARMAND_BLOBSLAP_WORKER;
-  }
-
-  const char *pid_file_option()
+  bool has_port_option() const
   {
-    return "--pid-file=";
-  }
-
-  const char *daemon_file_option()
-  {
-    return "--daemon";
-  }
-
-  const char *log_file_option()
-  {
-    return "--log-file=";
+    return true;
   }
 
-  const char *port_option()
+  bool has_log_file_option() const
   {
-    return "--port=";
+    return true;
   }
 
   bool is_libtool()
@@ -150,31 +133,27 @@ public:
     return true;
   }
 
-  bool build(int argc, const char *argv[]);
+  bool build(size_t argc, const char *argv[]);
 };
 
 
 #include <sstream>
 
-bool BlobslapWorker::build(int argc, const char *argv[])
+bool BlobslapWorker::build(size_t argc, const char *argv[])
 {
   std::stringstream arg_buffer;
 
-  for (int x= 1 ; x < argc ; x++)
+  for (size_t x= 0 ; x < argc ; x++)
   {
-    arg_buffer << " " << argv[x] << " ";
+    add_option(argv[x]);
   }
 
-  set_extra_args(arg_buffer.str());
-
   return true;
 }
 
-namespace libtest {
-
 Server *build_blobslap_worker(in_port_t try_port)
 {
   return new BlobslapWorker(try_port);
 }
 
-}
+} // namespace libtest