Skip to content
  • Eli Schwartz's avatar
    pactest: add environment option to run tests with valgrind · 3073752b
    Eli Schwartz authored and Allan McRae's avatar Allan McRae committed
    
    
    In autotools, if we wanted to run tests with valgrind, we used some Make
    magic which passed arguments to pactest.py, 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/
    
    or
    
    PACTEST_VALGRIND=1 make check
    
    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
    case.
    
    Signed-off-by: default avatarEli Schwartz <eschwartz@archlinux.org>
    Signed-off-by: default avatarAllan McRae <allan@archlinux.org>
    3073752b