Fix it so socket is built just on main tests.
[m6w6/libmemcached] / libtest / server.h
index f13cad0781c302f12aca53fdab500b8136d189c4..d987a0b7d3307e8e5ebde87b4014b022bc7d9104 100644 (file)
@@ -28,9 +28,9 @@ private:
   std::string _log_file;
   std::string _base_command; // executable command which include libtool, valgrind, gdb, etc
   std::string _running; // Current string being used for system()
+  pid_t _pid;
 
 protected:
-  pid_t _pid;
   in_port_t _port;
   std::string _hostname;
   std::string _extra_args;
@@ -92,7 +92,7 @@ public:
 
   virtual bool ping()= 0;
 
-  virtual pid_t get_pid(bool error_is_ok= true)= 0;
+  virtual pid_t get_pid(bool error_is_ok= false)= 0;
 
   virtual bool build(int argc, const char *argv[])= 0;
 
@@ -130,6 +130,11 @@ public:
     return (_pid > 1);
   }
 
+  bool check_pid(pid_t pid_arg) const
+  {
+    return (pid_arg > 1);
+  }
+
   bool is_socket() const
   {
     return _hostname[0] == '/';
@@ -142,7 +147,7 @@ public:
 
   std::string log_and_pid();
 
-  bool kill();
+  bool kill(pid_t pid_arg);
   bool start();
   bool command(std::string& command_arg);
 
@@ -150,6 +155,7 @@ protected:
   void nap();
 
 private:
+  bool is_helgrind() const;
   bool is_valgrind() const;
   bool is_debug() const;
   bool set_log_file();
@@ -165,6 +171,7 @@ class server_startup_st
 {
 private:
   std::string server_list;
+  bool _socket;
 
 public:
 
@@ -172,6 +179,7 @@ public:
   std::vector<Server *> servers;
 
   server_startup_st() :
+    _socket(false),
     udp(0)
   { }
 
@@ -185,8 +193,20 @@ public:
   }
 
   bool is_debug() const;
+  bool is_helgrind() const;
   bool is_valgrind() const;
 
+  bool socket()
+  {
+    return _socket;
+  }
+
+  void set_socket()
+  {
+    _socket= true;
+  }
+
+
   void shutdown(bool remove= false);
   void push_server(Server *);
   Server *pop_server();