Module Name:    src
Committed By:   sjg
Date:           Sat Aug 22 20:50:44 UTC 2020

Modified Files:
        src/usr.bin/make: Makefile
        src/usr.bin/make/unit-tests: Makefile

Log Message:
Use TEST_MAKE to run unit-tests

This lets us take advantage of new features like ${.SHELL}


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/make/Makefile
cvs rdiff -u -r1.110 -r1.111 src/usr.bin/make/unit-tests/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/Makefile
diff -u src/usr.bin/make/Makefile:1.90 src/usr.bin/make/Makefile:1.91
--- src/usr.bin/make/Makefile:1.90	Wed Aug 19 06:30:37 2020
+++ src/usr.bin/make/Makefile	Sat Aug 22 20:50:43 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.90 2020/08/19 06:30:37 rillig Exp $
+#	$NetBSD: Makefile,v 1.91 2020/08/22 20:50:43 sjg Exp $
 #	@(#)Makefile	5.2 (Berkeley) 12/28/90
 
 PROG=	make
@@ -165,9 +165,10 @@ COPTS.parse.c+=	${GCC_NO_FORMAT_TRUNCATI
 COPTS+=		-Wdeclaration-after-statement
 
 # A simple unit-test driver to help catch regressions
+TEST_MAKE ?= ${.OBJDIR}/${PROG:T}
 test: .MAKE
 	cd ${.CURDIR}/unit-tests \
-	&& MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
+	&& MAKEFLAGS= ${TEST_MAKE} -r -m / TEST_MAKE=${TEST_MAKE} ${.TARGET}
 .if ${USE_COVERAGE} == yes
 	${GCOV} ${GCOV_OPTS} ${SRCS}
 	sed -i 's,^\([^:]*\): *[0-9]*:,\1: ,' *.gcov

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.110 src/usr.bin/make/unit-tests/Makefile:1.111
--- src/usr.bin/make/unit-tests/Makefile:1.110	Sat Aug 22 20:23:14 2020
+++ src/usr.bin/make/unit-tests/Makefile	Sat Aug 22 20:50:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.110 2020/08/22 20:23:14 rillig Exp $
+# $NetBSD: Makefile,v 1.111 2020/08/22 20:50:43 sjg Exp $
 #
 # Unit tests for make(1)
 #
@@ -325,11 +325,11 @@ FLAGS.vardebug=		-k -dv FROM_CMDLINE=
 FLAGS.varmod-match-escape= -dv
 
 # Some tests need extra post-processing.
-SED_CMDS.sh-dots+=	-e '/not found/s,^.*sh: ,,'
+SED_CMDS.sh-dots+=	-e 's,^${.SHELL}: ,,'
 SED_CMDS.varmod-subst-regex+= \
 			-e 's,\(Regex compilation error:\).*,\1 (details omitted),'
 SED_CMDS.varmod-edge+=	-e 's, line [0-9]*:, line omitted:,'
-SED_CMDS.varshell+=	-e 's,^[a-z]*sh: ,,'
+SED_CMDS.varshell+=	-e 's,^${.SHELL:T}: ,,'
 SED_CMDS.varshell+=	-e '/command/s,No such.*,not found,'
 
 # Some tests need an additional round of postprocessing.

Reply via email to