Browse Source

Update valgrind path

Brian Aker 11 years ago
parent
commit
8acfbd7f9d
6 changed files with 20 additions and 4 deletions
  1. 1 1
      bootstrap.sh
  2. 3 1
      libtest/cmdline.cc
  3. 5 0
      libtest/drizzled.cc
  4. 5 0
      libtest/memcached.cc
  5. 5 1
      libtest/server.cc
  6. 1 1
      libtest/server.h

+ 1 - 1
bootstrap.sh

@@ -446,7 +446,7 @@ function setup_gdb_command () {
 function setup_valgrind_command () {
   VALGRIND_PROGRAM=`type -p valgrind`
   if [[ -n "$VALGRIND_PROGRAM" ]]; then
-    VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --malloc-fill=A5 --free-fill=DE --xml=yes --xml-file=\"valgrind-%p.xml\""
+    VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --malloc-fill=A5 --free-fill=DE --xml=yes --xml-file=\"tmp_chroot/valgrind-%p.xml\""
   fi
 }
 

+ 3 - 1
libtest/cmdline.cc

@@ -779,13 +779,15 @@ void Application::create_argv(const char *args[])
     vchar::append(built_argv, "--leak-check=yes");
 #if 0
     vchar::append(built_argv, "--show-reachable=yes"));
-#endif
     vchar::append(built_argv, "--track-fds=yes");
+#endif
 #if 0
     built_argv[x++]= strdup("--track-origin=yes");
 #endif
     vchar::append(built_argv, "--malloc-fill=A5");
     vchar::append(built_argv, "--free-fill=DE");
+    vchar::append(built_argv, "--xml=yes");
+    vchar::append(built_argv, "--xml-file=valgrind-cmd-\%p.xml");
 
     std::string log_file= create_tmpfile("valgrind");
     libtest::vchar_t buffer;

+ 5 - 0
libtest/drizzled.cc

@@ -166,6 +166,11 @@ public:
     return true;
   }
 
+  bool is_valgrind() const
+  {
+    return false;
+  }
+
   bool has_port_option() const
   {
     return true;

+ 5 - 0
libtest/memcached.cc

@@ -182,6 +182,11 @@ public:
     return true;
   }
 
+  bool is_valgrind() const
+  {
+    return false;
+  }
+
   // Memcached's pidfile is broken
   bool broken_pid_file()
   {

+ 5 - 1
libtest/server.cc

@@ -194,6 +194,10 @@ bool Server::has_pid() const
   return (_app.pid() > 1);
 }
 
+bool Server::is_valgrind() const
+{
+  return getenv("YATL_VALGRIND_SERVER") or valgrind_is_caller();
+}
 
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunreachable-code"
@@ -222,7 +226,7 @@ bool Server::start()
   {
     _app.use_ptrcheck(true);
   }
-  else if (getenv("YATL_VALGRIND_SERVER"))
+  else if (is_valgrind())
   {
     _app.use_valgrind(true);
   }

+ 1 - 1
libtest/server.h

@@ -278,7 +278,7 @@ protected:
 
 private:
   bool is_helgrind() const;
-  bool is_valgrind() const;
+  virtual bool is_valgrind() const;
   bool is_debug() const;
   bool set_log_file();
   bool set_socket_file();