Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): run tests with jemalloc deb...



details:   https://anonhg.NetBSD.org/src/rev/7de23ff2dc70
branches:  trunk
changeset: 939661:7de23ff2dc70
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 27 13:18:30 2020 +0000

description:
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:

 usr.bin/make/unit-tests/Makefile  |  6 ++++--
 usr.bin/make/unit-tests/export.mk |  4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r 9a65d65178cb -r 7de23ff2dc70 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sun Sep 27 12:42:09 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sun Sep 27 13:18:30 2020 +0000
@@ -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 @@
 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 @@
        @${_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 -r 9a65d65178cb -r 7de23ff2dc70 usr.bin/make/unit-tests/export.mk
--- a/usr.bin/make/unit-tests/export.mk Sun Sep 27 12:42:09 2020 +0000
+++ b/usr.bin/make/unit-tests/export.mk Sun Sep 27 13:18:30 2020 +0000
@@ -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 @@
 
 .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



Home | Main Index | Thread Index | Old Index