Merge in libtest updates.
[awesomized/libmemcached] / libtest / cmdline.cc
index 32d0809d82d2ecd8faf39846cafb7342ef689444..afd560b255263da3a6320075db5dccff8358d122 100644 (file)
@@ -38,6 +38,8 @@
 
 #include <libtest/cmdline.h>
 
+using namespace libtest;
+
 #include <cstdlib>
 #include <string>
 #include <sstream>
@@ -60,10 +62,15 @@ bool exec_cmdline(const std::string& executable, const char *args[])
     arg_buffer << " " << *ptr;
   }
 
-#if 0
-  arg_buffer << " > /dev/null 2>&1";
-#endif
-  std::cerr << std::endl << arg_buffer.str() << std::endl;
+  if (getenv("LIBTEST_TEST_ENVIRONMENT"))
+  {
+    std::cerr << std::endl << arg_buffer.str() << std::endl;
+  }
+  else
+  {
+    arg_buffer << " > /dev/null 2>&1";
+  }
+
   if (system(arg_buffer.str().c_str()) == -1)
   {
     return false;