1227
fi &&
1228
say_color error "$(cat "$TEST_RESULTS_SAN_FILE".*)" &&
1229
1230
- if test -n "$passes_sanitize_leak" && test "$test_failure" = 0
1231
- then
1232
- say "As TEST_PASSES_SANITIZE_LEAK=true and our logs show we're leaking, exit non-zero!" &&
1233
- invert_exit_code=t
1234
- elif test -n "$passes_sanitize_leak"
1235
- then
1236
- say "As TEST_PASSES_SANITIZE_LEAK=true and our logs show we're leaking, and we're failing for other reasons too..." &&
1237
- invert_exit_code=
1238
- elif test -n "$sanitize_leak_check" && test "$test_failure" = 0
1239
- then
1240
- say "As TEST_PASSES_SANITIZE_LEAK=true isn't set the above leak is 'ok' with GIT_TEST_PASSING_SANITIZE_LEAK=check" &&
1241
- invert_exit_code=
1242
- elif test -n "$sanitize_leak_check"
1243
- then
1244
- say "As TEST_PASSES_SANITIZE_LEAK=true isn't set the above leak is 'ok' with GIT_TEST_PASSING_SANITIZE_LEAK=check" &&
1245
- invert_exit_code=t
1246
- elif test "$test_failure" = 0
1230
+ if test "$test_failure" = 0
1231
then
1232
say "Our logs revealed a memory leak, exit non-zero!" &&
1233
invert_exit_code=t
1258
EOF
1259
fi
1260
1277
- if test -z "$passes_sanitize_leak" && test_bool_env TEST_PASSES_SANITIZE_LEAK false
1278
- then
1279
- BAIL_OUT "Please, set TEST_PASSES_SANITIZE_LEAK before sourcing test-lib.sh"
1280
- fi
1281
-
1261
if test "$test_fixed" != 0
1262
then
1263
say_color error "# $test_fixed known breakage(s) vanished; please update test(s)"
1494
test_done
1495
fi
1496
1518
-BAIL_OUT_ENV_NEEDS_SANITIZE_LEAK () {
1519
- BAIL_OUT "$1 has no effect except when compiled with SANITIZE=leak"
1520
-}
1521
-
1497
if test -n "$SANITIZE_LEAK"
1498
then
1524
- # Normalize with test_bool_env
1525
- passes_sanitize_leak=
1526
-
1527
- # We need to see TEST_PASSES_SANITIZE_LEAK in "test-tool
1528
- # env-helper" (via test_bool_env)
1529
- export TEST_PASSES_SANITIZE_LEAK
1530
- if test_bool_env TEST_PASSES_SANITIZE_LEAK false
1531
- then
1532
- passes_sanitize_leak=t
1533
- fi
1534
-
1535
- if test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check" ||
1536
- test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check-failing"
1537
- then
1538
- if test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check-failing" &&
1539
- test -n "$passes_sanitize_leak"
1540
- then
1541
- skip_all="skipping leak-free $this_test under GIT_TEST_PASSING_SANITIZE_LEAK=check-failing"
1542
- test_done
1543
- fi
1544
-
1545
- sanitize_leak_check=t
1546
- if test -n "$invert_exit_code"
1547
- then
1548
- BAIL_OUT "cannot use --invert-exit-code under GIT_TEST_PASSING_SANITIZE_LEAK=check"
1549
- fi
1550
-
1551
- if test -z "$passes_sanitize_leak"
1552
- then
1553
- say "in GIT_TEST_PASSING_SANITIZE_LEAK=check mode, setting --invert-exit-code for TEST_PASSES_SANITIZE_LEAK != true"
1554
- invert_exit_code=t
1555
- fi
1556
- elif test -z "$passes_sanitize_leak" &&
1557
- test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false
1558
- then
1559
- skip_all="skipping $this_test under GIT_TEST_PASSING_SANITIZE_LEAK=true"
1560
- test_done
1561
- fi
1562
-
1499
rm -rf "$TEST_RESULTS_SAN_DIR"
1500
if ! mkdir -p "$TEST_RESULTS_SAN_DIR"
1501
then
1510
prepend_var LSAN_OPTIONS : log_exe_name=1
1511
prepend_var LSAN_OPTIONS : log_path="'$TEST_RESULTS_SAN_FILE'"
1512
export LSAN_OPTIONS
1577
-
1578
-elif test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check" ||
1579
- test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check-failing" ||
1580
- test_bool_env GIT_TEST_PASSING_SANITIZE_LEAK false
1581
-then
1582
- BAIL_OUT_ENV_NEEDS_SANITIZE_LEAK "GIT_TEST_PASSING_SANITIZE_LEAK=true"
1513
fi
1514
1515
if test "${GIT_TEST_CHAIN_LINT:-1}" != 0 &&