summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2012-09-17 17:29:08 +0200
committerDan McGee <dan@archlinux.org>2012-09-18 15:09:57 +0200
commit19b8298ce88564e38683279664400572ce285f2e (patch)
tree4b71ee664b78e9f1a8adcb02a216a6f8eb0f53aa /test
parentc9b31ad6220e7706caf0bad55355957bfcd041cb (diff)
downloadpacman-19b8298ce88564e38683279664400572ce285f2e.tar.gz
pacman-19b8298ce88564e38683279664400572ce285f2e.tar.xz
pactest: allow running with valgrind from any directory
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. Dan: style cleanup. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/pmtest.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index 4e1ecd0b..5f0692f8 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -203,9 +203,12 @@ class pmtest(object):
if pacman["gdb"]:
cmd.extend(["libtool", "execute", "gdb", "--args"])
if pacman["valgrind"]:
+ suppfile = os.path.join(os.path.dirname(__file__),
+ '..', '..', 'valgrind.supp')
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" % suppfile])
cmd.extend([pacman["bin"],
"--config", os.path.join(self.root, util.PACCONF),
"--root", self.root,