[pacman-dev] [PATCH] pactest: allow running with valgrind from any directory

Allan McRae allan at archlinux.org
Mon Sep 17 11:35:07 EDT 2012


When using the --valgrind flag with the pactest.py script, the path
to the suppression file relies on the script being called from the
source root directory.  Construct the path from the scripts location
to allow it to be called from directory.

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 test/pacman/pmtest.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index 1a02686..625dccd 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -205,7 +205,8 @@ def run(self, pacman):
         if pacman["valgrind"]:
             cmd.extend(["libtool", "execute", "valgrind", "-q",
                 "--tool=memcheck", "--leak-check=full",
-                "--show-reachable=yes", "--suppressions=%s/valgrind.supp" % os.getcwd()])
+                "--show-reachable=yes",
+                "--suppressions=%s" % os.path.join(os.path.dirname( __file__ ), '..', '..', 'valgrind.supp') ])
         cmd.extend([pacman["bin"],
             "--config", os.path.join(self.root, util.PACCONF),
             "--root", self.root,
-- 
1.7.12



More information about the pacman-dev mailing list