Dothem: run with leaks and sha256

Junio C Hamano committed Dec 13, 2024 at 08:54 UTC 633ba22dc530753357e20bc435acddd741fe70f3
1 file changed +30 -1
Dothem
+30 -1
@@ -18,7 +18,7 @@ inst_prefix=$(
18 )
19
20 force= with_dash= test_long= M= install= doc= notest= bootstrap= branches= jobs=
21 -scratch= noprove= memtrash=--memtrash with_cocci= san= clean=
21 +scratch= noprove= memtrash=--memtrash with_cocci= with_leaks= with_sha256= san= clean=
22 while case "$1" in
23 --pedantic | --locale=* | --loose) M="$M $1" ;;
24 --force) force=$1 ;;
@@ -41,6 +41,8 @@ while case "$1" in
41 --branches=*) branches=${1#*=} ;;
42 --noprove) noprove=$1 ;;
43 --san) san=t ;;
44 + --leaks) with_leaks=t ;;
45 + --sha256) with_sha256=t ;;
46 -j*) jobs=$1 ;;
47 --) shift; break ;;
48 -*) echo >&2 "Unknown option: $1"; exit 1 ;;
@@ -229,16 +231,21 @@ do
231
232 save=$(git rev-parse HEAD) &&
233
234 + # cocci
235 if test -n "$with_cocci"
236 then
237 Meta/Make $M $jobs -- coccicheck
238 fi &&
239
240 + # sparse
241 Meta/Make $M $jobs -- NO_REGEX=NoThanks \
242 SPARSE_FLAGS=-Wsparse-error sparse &&
243 rm -f compat/regex/regex.o &&
244 +
245 + # hdr
246 Meta/Make $M $jobs -- hdr-check &&
247
248 + # SANITIZE=address,undefined
249 case "$dotest,$san" in
250 '')
251 ;;
@@ -252,6 +259,17 @@ do
259 ;;
260 esac &&
261
262 + # sha256
263 + if test -n "$with_sha256"
264 + then
265 + (
266 + export GIT_TEST_DEFAULT_HASH=sha256
267 + Meta/Make -j16 $T test &&
268 + Meta/Make >/dev/null distclean
269 + )
270 + fi &&
271 +
272 + # docs
273 {
274 test -n "$skip_doc" ||
275 if test "$save" = "$(git rev-parse HEAD)"
@@ -264,6 +282,17 @@ do
282 fi
283 } &&
284
285 + # leaks
286 + if test -n "with_leaks"
287 + then
288 + (
289 + export SANITIZE=leak
290 + export GIT_TEST_PASSING_SANITIZE_LEAK=true
291 + Meta/Make -j16 $T CC=clang test &&
292 + Meta/Make -j16 >/dev/null distclean
293 + )
294 + fi &&
295 +
296 {
297 test z$install = znoinstall ||
298 if test "$save" = "$(git rev-parse HEAD)"