]> git.ipfire.org Git - thirdparty/git.git/commit
t/test-lib: allow skipping leak checks for passing tests
authorPatrick Steinhardt <ps@pks.im>
Thu, 5 Sep 2024 10:08:38 +0000 (12:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Sep 2024 15:49:10 +0000 (08:49 -0700)
commita9539a993a2b4dbfb5540aebb02bfcfd5be4c24f
tree1c69a158d78f66f2c3b7a60982338fd42ed0bd55
parent6a09c36371cbb902c573aee38d7cfd38f884f448
t/test-lib: allow skipping leak checks for passing tests

With `GIT_TEST_PASSING_SANITIZE_LEAK=check`, one can double check
whether a memory leak fix caused some test suites to become leak free.
This is done by running all tests with the leak checker enabled. If a
test suite does not declare `TEST_PASSES_SANITIZE_LEAK=true` but still
finishes successfully with the leak checker enabled, then this indicates
that the test is leak free and thus missing the annotation.

It is somewhat slow to execute though because it runs all of our test
suites with the leak sanitizer enabled. It is also pointless in most
cases, because the only test suites that need to be checked are those
which _aren't_ yet marked with `TEST_PASSES_SANITIZE_LEAK=true`.

Introduce a new value "check-failing". When set, we behave the same as
if "check" was passed, except that we only check those tests which do
not have `TEST_PASSES_SANITIZE_LEAK=true` set. This is significantly
faster than running all test suites but still fulfills the usecase of
finding newly-leak-free test suites.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/README
t/test-lib.sh