Makefile: add SANITIZE=leak flag to GIT-BUILD-OPTIONS
When SANITIZE=leak is specified we'll now add a SANITIZE_LEAK flag to GIT-BUILD-OPTIONS, this can then be picked up by the test-lib.sh, which sets a SANITIZE_LEAK prerequisite. We can then skip specific tests that are known to fail under SANITIZE=leak, add one such annotation to t0004-unwritable.sh, which now passes under SANITIZE=leak. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
e0a2f5cbc5
commit
2cdc292b31
5
Makefile
5
Makefile
|
@ -1221,6 +1221,9 @@ PTHREAD_CFLAGS =
|
||||||
SPARSE_FLAGS ?=
|
SPARSE_FLAGS ?=
|
||||||
SP_EXTRA_FLAGS = -Wno-universal-initializer
|
SP_EXTRA_FLAGS = -Wno-universal-initializer
|
||||||
|
|
||||||
|
# For informing GIT-BUILD-OPTIONS of the SANITIZE=leak target
|
||||||
|
SANITIZE_LEAK =
|
||||||
|
|
||||||
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
|
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
|
||||||
# usually result in less CPU usage at the cost of higher peak memory.
|
# usually result in less CPU usage at the cost of higher peak memory.
|
||||||
# Setting it to 0 will feed all files in a single spatch invocation.
|
# Setting it to 0 will feed all files in a single spatch invocation.
|
||||||
|
@ -1265,6 +1268,7 @@ BASIC_CFLAGS += -DSHA1DC_FORCE_ALIGNED_ACCESS
|
||||||
endif
|
endif
|
||||||
ifneq ($(filter leak,$(SANITIZERS)),)
|
ifneq ($(filter leak,$(SANITIZERS)),)
|
||||||
BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
|
BASIC_CFLAGS += -DSUPPRESS_ANNOTATED_LEAKS
|
||||||
|
SANITIZE_LEAK = YesCompiledWithIt
|
||||||
endif
|
endif
|
||||||
ifneq ($(filter address,$(SANITIZERS)),)
|
ifneq ($(filter address,$(SANITIZERS)),)
|
||||||
NO_REGEX = NeededForASAN
|
NO_REGEX = NeededForASAN
|
||||||
|
@ -2812,6 +2816,7 @@ GIT-BUILD-OPTIONS: FORCE
|
||||||
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
|
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
|
||||||
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
|
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
|
||||||
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
|
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
|
||||||
|
@echo SANITIZE_LEAK=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_LEAK)))'\' >>$@+
|
||||||
@echo X=\'$(X)\' >>$@+
|
@echo X=\'$(X)\' >>$@+
|
||||||
ifdef TEST_OUTPUT_DIRECTORY
|
ifdef TEST_OUTPUT_DIRECTORY
|
||||||
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
|
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
|
||||||
|
|
|
@ -21,7 +21,7 @@ test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable reposi
|
||||||
test_must_fail git write-tree
|
test_must_fail git write-tree
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' '
|
test_expect_success POSIXPERM,SANITY,!SANITIZE_LEAK 'commit should notice unwritable repository' '
|
||||||
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
|
test_when_finished "chmod 775 .git/objects .git/objects/??" &&
|
||||||
chmod a-w .git/objects .git/objects/?? &&
|
chmod a-w .git/objects .git/objects/?? &&
|
||||||
test_must_fail git commit -m second
|
test_must_fail git commit -m second
|
||||||
|
|
|
@ -1533,6 +1533,7 @@ test -z "$NO_PYTHON" && test_set_prereq PYTHON
|
||||||
test -n "$USE_LIBPCRE2" && test_set_prereq PCRE
|
test -n "$USE_LIBPCRE2" && test_set_prereq PCRE
|
||||||
test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
|
test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
|
||||||
test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
|
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"
|
if test -z "$GIT_TEST_CHECK_CACHE_TREE"
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue