[pacman-dev] [PATCH 2/5] pmtest: send valgrind output to var/log/valgrind

Andrew Gregory andrew.gregory.8 at gmail.com
Mon Jan 6 15:19:31 EST 2014


This will allow us to detect whether valgrind found any errors while
still preserving pacman's return code for tests.

Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 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 2c50f2a..e5094a1 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -220,6 +220,7 @@ def run(self, pacman):
             cmd.extend(["libtool", "execute", "valgrind", "-q",
                 "--tool=memcheck", "--leak-check=full",
                 "--show-reachable=yes",
+                "--log-file=%s" % os.path.join(self.root, "var/log/valgrind"),
                 "--suppressions=%s" % suppfile])
         cmd.extend([pacman["bin"],
             "--config", os.path.join(self.root, util.PACCONF),
@@ -231,7 +232,7 @@ def run(self, pacman):
         if pacman["debug"]:
             cmd.append("--debug=%s" % pacman["debug"])
         cmd.extend(shlex.split(self.args))
-        if not (pacman["gdb"] or pacman["valgrind"] or pacman["nolog"]):
+        if not (pacman["gdb"] or pacman["nolog"]):
             output = open(os.path.join(self.root, util.LOGFILE), 'w')
         else:
             output = None
-- 
1.8.5.2



More information about the pacman-dev mailing list