Meta/Dothem: optionally run various sanitizer tests with --san option

Junio C Hamano committed Oct 10, 2022 at 14:34 UTC 244d1719af1ee07beccaf13a7de9b7d5e4bb0e29
1 file changed +13 -1
Dothem
+13 -1
@@ -18,7 +18,7 @@ inst_prefix=$(
18 )
19
20 force= with_dash= test_long= M= install= nodoc= notest= bootstrap= branches= jobs=
21 -scratch= noprove= memtrash=--memtrash with_cocci=
21 +scratch= noprove= memtrash=--memtrash with_cocci= san=
22 while case "$1" in
23 --pedantic | --locale=* | --loose) M="$M $1" ;;
24 --force) force=$1 ;;
@@ -37,6 +37,7 @@ while case "$1" in
37 --base=*) BUILDBASE=${1#*=} ;;
38 --branches=*) branches=${1#*=} ;;
39 --noprove) noprove=$1 ;;
40 + --san) san=t ;;
41 -j*) jobs=$1 ;;
42 --) shift; break ;;
43 -*) echo >&2 "Unknown option: $1"; exit 1 ;;
@@ -211,6 +212,17 @@ do
212
213 Meta/Make $M $jobs -- hdr-check &&
214
215 + case "$san" in
216 + '') ;;
217 + ?*)
218 + SANITIZE=address Meta/Make $M $jobs test &&
219 + SANITIZE=undefined Meta/Make $M $jobs test &&
220 + SANITIZE=leak \
221 + GIT_TEST_PASSING_SANITIZE_LEAK=true Meta/Make $M $jobs test &&
222 + Meta/Make distclean >/dev/null 2>&1
223 + ;;
224 + esac &&
225 +
226 Meta/Make $M $noprove ${test+"$test"} $jobs $test_long $memtrash \
227 -- ${with_dash:+SHELL_PATH=/bin/dash} "$@" $dotest &&
228