From bcaae46a31060a650164511dbe3f8fb45241f2b4 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 23 Sep 2025 13:26:06 +0200 Subject: [PATCH] meson: Add valgrind test setup Similarly to libtools, add a test setup to meson so that tests can be run under valgrind even with meson: meson test -C $builddir --setup valgrind Since meson has a timeout for individual tests (30 seconds) and valgrind makes everything run slower, the timeout needs to be increased (factor of 4 looks good enough). Signed-off-by: Michal Privoznik --- meson.build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meson.build b/meson.build index 1d4b6c3b5..12a165fe0 100644 --- a/meson.build +++ b/meson.build @@ -532,6 +532,15 @@ foreach check, deps : checks endif endforeach +add_test_setup( + 'valgrind', + exe_wrapper: [ + 'valgrind', '--quiet', '--leak-check=full', '--error-exitcode=1', + ], + # default timeout in meson is 30s + timeout_multiplier: 4, +) + if want_output sh = find_program('sh', required: false)