]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/test-lib.sh
Merge branch 'ab/sanitize-leak-ci' into ab/unpack-trees-leakfix
[thirdparty/git.git] / t / test-lib.sh
index aa1ad8180ed877b51280ff908e30a81aa397715a..8361b5c1c574ed031ec5aaac1332297055450e07 100644 (file)
@@ -1381,6 +1381,26 @@ then
        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"
@@ -1534,6 +1554,7 @@ test -z "$NO_PYTHON" && test_set_prereq PYTHON
 test -n "$USE_LIBPCRE2" && test_set_prereq PCRE
 test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
 test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
+test -n "$SANITIZE_LEAK" && test_set_prereq SANITIZE_LEAK
 
 if test -z "$GIT_TEST_CHECK_CACHE_TREE"
 then