diff options
| author | rillig <rillig@NetBSD.org> | 2020-09-27 13:18:30 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2020-09-27 13:18:30 +0000 |
| commit | 81ac048e4cc267a950cbaa5300a5ee8efd9a1d17 (patch) | |
| tree | 1f629ef0dc2742ee79e2dbebb9596ce2e2d46a25 /usr.bin | |
| parent | 62d26c519df1a77bf3d05a51086f9d715f0124c0 (diff) | |
make(1): run tests with jemalloc debugging enabled
This protects against very simple memory allocation bugs such as
migrating Lst_ForEachUntil to Lst_ForEach without remembering that
Lst_ForEachUntil can handle the situation where the current list node is
removed from the list, but Lst_ForEach cannot. This happens in
Make_ExpandUse, for example.
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/make/unit-tests/Makefile | 6 | ||||
| -rw-r--r-- | usr.bin/make/unit-tests/export.mk | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index 3c59e73ee45..fbec31aec2c 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.152 2020/09/25 23:24:49 rillig Exp $ +# $NetBSD: Makefile,v 1.153 2020/09/27 13:18:30 rillig Exp $ # # Unit tests for make(1) # @@ -447,6 +447,8 @@ LC_ALL= C LANG= C .export LANG LC_ALL +MAKE_TEST_ENV?= MALLOC_OPTIONS="JA" # for jemalloc + # Each test is run in a sub-make, to keep the tests for interfering with # each other, and because they use different environment variables and # command line options. @@ -455,7 +457,7 @@ LANG= C @${_MKMSG_TEST:Uecho '# test '} ${.PREFIX} @set -eu; \ cd ${.OBJDIR}; \ - env -i PATH="$$PATH" ${ENV.${.PREFIX:T}} \ + env -i PATH="$$PATH" ${MAKE_TEST_ENV} ${ENV.${.PREFIX:T}} \ ${TEST_MAKE} \ -r -C ${.CURDIR} -f ${.IMPSRC} \ ${FLAGS.${.PREFIX:T}:U-k} \ diff --git a/usr.bin/make/unit-tests/export.mk b/usr.bin/make/unit-tests/export.mk index 4b1ac3457d1..8f9d03de66f 100644 --- a/usr.bin/make/unit-tests/export.mk +++ b/usr.bin/make/unit-tests/export.mk @@ -1,4 +1,4 @@ -# $Id: export.mk,v 1.5 2020/08/08 13:00:07 rillig Exp $ +# $Id: export.mk,v 1.6 2020/09/27 13:18:30 rillig Exp $ UT_TEST=export UT_FOO=foo${BAR} @@ -37,7 +37,7 @@ BAR=bar is ${UT_FU} .MAKE.EXPORTED+= UT_ZOO UT_TEST -FILTER_CMD?= egrep -v '^(MAKEFLAGS|PATH|PWD|SHLVL|_)=' +FILTER_CMD?= egrep -v '^(MAKEFLAGS|MALLOC_OPTIONS|PATH|PWD|SHLVL|_)=' all: @env | ${FILTER_CMD} | sort |
