From: Junio C Hamano Date: Thu, 7 Oct 2021 22:28:38 +0000 (-0700) Subject: Merge branch 'ab/sanitize-leak-ci' into ab/mark-leak-free-tests X-Git-Tag: v2.34.0-rc0~30^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25dc57bac8ea77a12a98df75d2f1296dea9d9fa9;p=thirdparty%2Fgit.git Merge branch 'ab/sanitize-leak-ci' into ab/mark-leak-free-tests * ab/sanitize-leak-ci: tests: add a test mode for SANITIZE=leak, run it in CI Makefile: add SANITIZE=leak flag to GIT-BUILD-OPTIONS --- 25dc57bac8ea77a12a98df75d2f1296dea9d9fa9 diff --cc t/test-lib.sh index aa1ad8180e,3b7acfec23..8361b5c1c5 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -1381,11 -1379,30 +1381,31 @@@ the test_done fi + # skip non-whitelisted tests when compiled with SANITIZE=leak + if test -n "$SANITIZE_LEAK" + then + if test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false + then + # We need to see it in "git env--helper" (via + # test_bool_env) + export TEST_PASSES_SANITIZE_LEAK + + if ! test_bool_env TEST_PASSES_SANITIZE_LEAK false + then + skip_all="skipping $this_test under GIT_TEST_PASSING_SANITIZE_LEAK=true" + test_done + fi + fi + elif test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false + then + error "GIT_TEST_PASSING_SANITIZE_LEAK=true has no effect except when compiled with SANITIZE=leak" + fi + # Last-minute variable setup +USER_HOME="$HOME" HOME="$TRASH_DIRECTORY" GNUPGHOME="$HOME/gnupg-home-not-used" -export HOME GNUPGHOME +export HOME GNUPGHOME USER_HOME # Test repository rm -fr "$TRASH_DIRECTORY" || {