Commit 3073752b authored by Eli Schwartz's avatar Eli Schwartz Committed by Allan McRae
Browse files

pactest: add environment option to run tests with valgrind

In autotools, if we wanted to run tests with valgrind, we used some Make
magic which passed arguments to, but that doesn't work in
meson, because all arguments are encoded at configure time. Instead,
let's short-circuit the build runner logic entirely, and teach pactest
to default to running valgrind, when it detects an environment variable
set independent of the build system.

To run the tests with valgrind, we can now use:

PACTEST_VALGRIND=1 meson test -C builddir/



It is also possible, but confusing/inconsistent, to use

make check PY_LOG_FLAGS=--valgrind

We *could* add a meson option -Dvalgrind=true, but that is annoying to
reconfigure between test runs, and overall the consensus is it seems
simpler to opt in each time we want to run valgrind, as was already the

Signed-off-by: Eli Schwartz's avatarEli Schwartz <>
Signed-off-by: Allan McRae's avatarAllan McRae <>
parent 49a8e90b
......@@ -96,7 +96,7 @@ def create_parser():
dest = "gdb", default = False,
help = "use gdb while calling pacman")
parser.add_option("--valgrind", action = "store_true",
dest = "valgrind", default = False,
dest = "valgrind", default = os.getenv('PACTEST_VALGRIND'),
help = "use valgrind while calling pacman")
parser.add_option("--manual-confirm", action = "store_true",
dest = "manualconfirm", default = False,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment