Merge of build trunk.
[m6w6/libmemcached] / libtest / cmdline.cc
index 6c71f9b0935a13f8b4b78f49f864010dc82c016e..4dc84c9d66990d547f48f40180530c2977b259be 100644 (file)
 
 #include <libtest/common.h>
 
-#include <libtest/cmdline.h>
-
 using namespace libtest;
 
 #include <cstdlib>
 #include <string>
 #include <sstream>
 
+namespace libtest {
+
 bool exec_cmdline(const std::string& executable, const char *args[])
 {
   std::stringstream arg_buffer;
 
-  arg_buffer << "./libtool --mode=execute ";
+  arg_buffer << libtool();
 
-  if (getenv("LIBTEST_TEST_ENVIRONMENT"))
+  if (getenv("PWD"))
   {
-    arg_buffer << getenv("LIBTEST_TEST_ENVIRONMENT");
-    arg_buffer << " ";
+    arg_buffer << getenv("PWD");
+    arg_buffer << "/";
   }
 
   arg_buffer << executable;
@@ -47,14 +47,9 @@ bool exec_cmdline(const std::string& executable, const char *args[])
     arg_buffer << " " << *ptr;
   }
 
-  if (getenv("LIBTEST_TEST_ENVIRONMENT"))
-  {
-    std::cerr << std::endl << arg_buffer.str() << std::endl;
-  }
-  else
-  {
+#if 0
     arg_buffer << " > /dev/null 2>&1";
-  }
+#endif
 
   if (system(arg_buffer.str().c_str()) == -1)
   {
@@ -63,3 +58,10 @@ bool exec_cmdline(const std::string& executable, const char *args[])
 
   return true;
 }
+
+const char *gearmand_binary() 
+{
+  return GEARMAND_BINARY;
+}
+
+} // namespace exec_cmdline