Re: [PATCH 2/5] test-lib: turn on ASan abort_on_error by default
Jeff Kingwrites: > By default, ASan will exit with code 1 when it sees an > error. This means we'll notice a problem when we expected > git to succeed, but not in a test_must_fail block. > > Let's ask it to actually raise SIGABRT instead. That will > give us a signal death that test_must_fail will notice. As a > bonus, it may also leave a coredump, which can be handy for > digging into a failure. Well thought-out. Thanks. > Signed-off-by: Jeff King > --- > t/test-lib.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/t/test-lib.sh b/t/test-lib.sh > index 961194a50..1b6e53f78 100644 > --- a/t/test-lib.sh > +++ b/t/test-lib.sh > @@ -41,7 +41,7 @@ GIT_BUILD_DIR="$TEST_DIRECTORY"/.. > # the noise level. This needs to happen at the start of the script, > # before we even do our "did we build git yet" check (since we don't > # want that one to complain to stderr). > -: ${ASAN_OPTIONS=detect_leaks=0} > +: ${ASAN_OPTIONS=detect_leaks=0:abort_on_error=1} > export ASAN_OPTIONS > >
[PATCH 2/5] test-lib: turn on ASan abort_on_error by default
By default, ASan will exit with code 1 when it sees an error. This means we'll notice a problem when we expected git to succeed, but not in a test_must_fail block. Let's ask it to actually raise SIGABRT instead. That will give us a signal death that test_must_fail will notice. As a bonus, it may also leave a coredump, which can be handy for digging into a failure. Signed-off-by: Jeff King--- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 961194a50..1b6e53f78 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -41,7 +41,7 @@ GIT_BUILD_DIR="$TEST_DIRECTORY"/.. # the noise level. This needs to happen at the start of the script, # before we even do our "did we build git yet" check (since we don't # want that one to complain to stderr). -: ${ASAN_OPTIONS=detect_leaks=0} +: ${ASAN_OPTIONS=detect_leaks=0:abort_on_error=1} export ASAN_OPTIONS -- 2.13.2.1071.gcd8104b61