[pacman-dev] [PATCHv2 2/2] pmtest: add memory check to tests with valgrind
Andrew Gregory
andrew.gregory.8 at gmail.com
Mon Feb 3 12:05:48 EST 2014
Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
test/pacman/README | 5 +++++
test/pacman/pmtest.py | 1 +
2 files changed, 6 insertions(+)
diff --git a/test/pacman/README b/test/pacman/README
index 2516a8a..8d8354a 100644
--- a/test/pacman/README
+++ b/test/pacman/README
@@ -62,6 +62,11 @@ This example will run all tests from the "tests" directory.
Use the "help" option to get the full list of parameters:
./pactest.py --help
+When run with the `--valgrind' option, an additional rule will be added to all
+tests to check for memory leaks. To use `--valgrind' when running the full
+test suite, run:
+ make PY_LOG_FLAGS=--valgrind check
+
The following pieces of software are required to run the pactest suite:
fakeroot (required to run as non-root user)
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index e780a6d..7079b78 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -224,6 +224,7 @@ def run(self, pacman):
"--child-silent-after-fork=yes",
"--log-file=%s" % os.path.join(self.root, "var/log/valgrind"),
"--suppressions=%s" % suppfile])
+ self.addrule("FILE_EMPTY=var/log/valgrind")
cmd.extend([pacman["bin"],
"--config", os.path.join(self.root, util.PACCONF),
"--root", self.root,
--
1.8.5.3
More information about the pacman-dev
mailing list