Module Name:    src
Committed By:   rillig
Date:           Mon Nov  9 20:50:56 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: Makefile envfirst.mk opt-ignore.mk
            opt-keep-going.mk opt-no-action.mk opt-query.mk opt-var-expanded.mk
            opt-var-literal.mk opt-warnings-as-errors.exp
            opt-warnings-as-errors.mk order.mk recursive.exp recursive.mk
            sh-leading-plus.mk

Log Message:
make(1): in tests, move command line arguments into the test proper


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/envfirst.mk \
    src/usr.bin/make/unit-tests/opt-no-action.mk \
    src/usr.bin/make/unit-tests/opt-query.mk \
    src/usr.bin/make/unit-tests/opt-var-expanded.mk \
    src/usr.bin/make/unit-tests/opt-var-literal.mk \
    src/usr.bin/make/unit-tests/opt-warnings-as-errors.mk \
    src/usr.bin/make/unit-tests/recursive.mk \
    src/usr.bin/make/unit-tests/sh-leading-plus.mk
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/opt-ignore.mk \
    src/usr.bin/make/unit-tests/opt-keep-going.mk
cvs rdiff -u -r1.2 -r1.3 \
    src/usr.bin/make/unit-tests/opt-warnings-as-errors.exp \
    src/usr.bin/make/unit-tests/recursive.exp
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/order.mk

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/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.194 src/usr.bin/make/unit-tests/Makefile:1.195
--- src/usr.bin/make/unit-tests/Makefile:1.194	Mon Nov  9 20:39:46 2020
+++ src/usr.bin/make/unit-tests/Makefile	Mon Nov  9 20:50:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.194 2020/11/09 20:39:46 rillig Exp $
+# $NetBSD: Makefile,v 1.195 2020/11/09 20:50:56 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -392,19 +392,7 @@ ENV.varmod-localtime+=	TZ=Europe/Berlin
 # settings FLAGS.test=-dv here, since that is closer to the test code.
 FLAGS.cond-func-make=	via-cmdline
 FLAGS.directive-ifmake=	first second
-FLAGS.doterror=		# none
-FLAGS.envfirst=		-e
-FLAGS.export=		# none
-FLAGS.opt-ignore=	-i
-FLAGS.opt-keep-going=	-k
-FLAGS.opt-no-action=	-n
-FLAGS.opt-query=	-q
-FLAGS.opt-var-expanded=	-v VAR -v VALUE
-FLAGS.opt-var-literal=	-V VAR -V VALUE
-FLAGS.opt-warnings-as-errors= -W
-FLAGS.order=		-j1
-FLAGS.recursive=	-dL
-FLAGS.sh-leading-plus=	-n
+FLAGS.doterror=		# none, especially not -k
 FLAGS.varname-empty=	-dv '$${:U}=cmdline-u' '=cmline-plain'
 
 # Some tests need extra postprocessing.

Index: src/usr.bin/make/unit-tests/envfirst.mk
diff -u src/usr.bin/make/unit-tests/envfirst.mk:1.3 src/usr.bin/make/unit-tests/envfirst.mk:1.4
--- src/usr.bin/make/unit-tests/envfirst.mk:1.3	Sat Oct 24 08:46:08 2020
+++ src/usr.bin/make/unit-tests/envfirst.mk	Mon Nov  9 20:50:56 2020
@@ -1,7 +1,9 @@
-# $NetBSD: envfirst.mk,v 1.3 2020/10/24 08:46:08 rillig Exp $
+# $NetBSD: envfirst.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # The -e option makes environment variables stronger than global variables.
 
+.MAKEFLAGS: -e
+
 .if ${FROM_ENV} != value-from-env
 .  error ${FROM_ENV}
 .endif
Index: src/usr.bin/make/unit-tests/opt-no-action.mk
diff -u src/usr.bin/make/unit-tests/opt-no-action.mk:1.3 src/usr.bin/make/unit-tests/opt-no-action.mk:1.4
--- src/usr.bin/make/unit-tests/opt-no-action.mk:1.3	Wed Aug 19 05:25:26 2020
+++ src/usr.bin/make/unit-tests/opt-no-action.mk	Mon Nov  9 20:50:56 2020
@@ -1,9 +1,11 @@
-# $NetBSD: opt-no-action.mk,v 1.3 2020/08/19 05:25:26 rillig Exp $
+# $NetBSD: opt-no-action.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for the -n command line option, which runs almost no commands.
 # It just outputs them, to be inspected by human readers.
 # Only commands that are in a .MAKE target or prefixed by '+' are run.
 
+.MAKEFLAGS: -n
+
 # This command cannot be prevented from being run since it is used at parse
 # time, and any later variable assignments may depend on its result.
 !=	echo 'command during parsing' 1>&2; echo
Index: src/usr.bin/make/unit-tests/opt-query.mk
diff -u src/usr.bin/make/unit-tests/opt-query.mk:1.3 src/usr.bin/make/unit-tests/opt-query.mk:1.4
--- src/usr.bin/make/unit-tests/opt-query.mk:1.3	Wed Aug 19 05:13:18 2020
+++ src/usr.bin/make/unit-tests/opt-query.mk	Mon Nov  9 20:50:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-query.mk,v 1.3 2020/08/19 05:13:18 rillig Exp $
+# $NetBSD: opt-query.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for the -q command line option.
 #
@@ -6,6 +6,8 @@
 # None of the commands in the targets are run, not even those that are
 # prefixed with '+'.
 
+.MAKEFLAGS: -q
+
 # This command cannot be prevented from being run since it is used at parse
 # time, and any later variable assignments may depend on its result.
 !=	echo 'command during parsing' 1>&2; echo
Index: src/usr.bin/make/unit-tests/opt-var-expanded.mk
diff -u src/usr.bin/make/unit-tests/opt-var-expanded.mk:1.3 src/usr.bin/make/unit-tests/opt-var-expanded.mk:1.4
--- src/usr.bin/make/unit-tests/opt-var-expanded.mk:1.3	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-var-expanded.mk	Mon Nov  9 20:50:56 2020
@@ -1,6 +1,8 @@
-# $NetBSD: opt-var-expanded.mk,v 1.3 2020/08/23 14:28:04 rillig Exp $
+# $NetBSD: opt-var-expanded.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for the -v command line option.
 
+.MAKEFLAGS: -v VAR -v VALUE
+
 VAR=	other ${VALUE} $$$$
 VALUE=	value
Index: src/usr.bin/make/unit-tests/opt-var-literal.mk
diff -u src/usr.bin/make/unit-tests/opt-var-literal.mk:1.3 src/usr.bin/make/unit-tests/opt-var-literal.mk:1.4
--- src/usr.bin/make/unit-tests/opt-var-literal.mk:1.3	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-var-literal.mk	Mon Nov  9 20:50:56 2020
@@ -1,6 +1,8 @@
-# $NetBSD: opt-var-literal.mk,v 1.3 2020/08/23 14:28:04 rillig Exp $
+# $NetBSD: opt-var-literal.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for the -V command line option.
 
+.MAKEFLAGS: -V VAR -V VALUE
+
 VAR=	other ${VALUE} $$$$
 VALUE=	value
Index: src/usr.bin/make/unit-tests/opt-warnings-as-errors.mk
diff -u src/usr.bin/make/unit-tests/opt-warnings-as-errors.mk:1.3 src/usr.bin/make/unit-tests/opt-warnings-as-errors.mk:1.4
--- src/usr.bin/make/unit-tests/opt-warnings-as-errors.mk:1.3	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-warnings-as-errors.mk	Mon Nov  9 20:50:56 2020
@@ -1,7 +1,9 @@
-# $NetBSD: opt-warnings-as-errors.mk,v 1.3 2020/08/23 14:28:04 rillig Exp $
+# $NetBSD: opt-warnings-as-errors.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for the -W command line option, which turns warnings into errors.
 
+.MAKEFLAGS: -W
+
 .warning message 1
 .warning message 2
 
Index: src/usr.bin/make/unit-tests/recursive.mk
diff -u src/usr.bin/make/unit-tests/recursive.mk:1.3 src/usr.bin/make/unit-tests/recursive.mk:1.4
--- src/usr.bin/make/unit-tests/recursive.mk:1.3	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/recursive.mk	Mon Nov  9 20:50:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: recursive.mk,v 1.3 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: recursive.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # In -dL mode, a variable may get expanded before it makes sense.
 # This would stop make from doing anything since the "recursive" error
@@ -11,6 +11,8 @@
 # Seen in pkgsrc/x11/libXfixes, and probably many more package that use
 # GNU Automake.
 
+.MAKEFLAGS: -dL
+
 AM_V_lt=	${am__v_lt_${V}}
 am__v_lt_=	${am__v_lt_${AM_DEFAULT_VERBOSITY}}
 am__v_lt_0=	--silent
Index: src/usr.bin/make/unit-tests/sh-leading-plus.mk
diff -u src/usr.bin/make/unit-tests/sh-leading-plus.mk:1.3 src/usr.bin/make/unit-tests/sh-leading-plus.mk:1.4
--- src/usr.bin/make/unit-tests/sh-leading-plus.mk:1.3	Sun Aug 23 14:46:33 2020
+++ src/usr.bin/make/unit-tests/sh-leading-plus.mk	Mon Nov  9 20:50:56 2020
@@ -1,8 +1,10 @@
-# $NetBSD: sh-leading-plus.mk,v 1.3 2020/08/23 14:46:33 rillig Exp $
+# $NetBSD: sh-leading-plus.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for shell commands preceded by a '+', to run them even if
 # the command line option -n is given.
 
+.MAKEFLAGS: -n
+
 all:
 	@echo 'this command is not run'
 	@+echo 'this command is run'

Index: src/usr.bin/make/unit-tests/opt-ignore.mk
diff -u src/usr.bin/make/unit-tests/opt-ignore.mk:1.4 src/usr.bin/make/unit-tests/opt-ignore.mk:1.5
--- src/usr.bin/make/unit-tests/opt-ignore.mk:1.4	Sun Oct 18 18:12:42 2020
+++ src/usr.bin/make/unit-tests/opt-ignore.mk	Mon Nov  9 20:50:56 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-ignore.mk,v 1.4 2020/10/18 18:12:42 rillig Exp $
+# $NetBSD: opt-ignore.mk,v 1.5 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for the -i command line option, which ignores the exit status of the
 # shell commands, and just continues with the next command, even from the same
@@ -11,6 +11,7 @@
 # failed?
 
 .MAKEFLAGS: -d0			# switch stdout to being line-buffered
+.MAKEFLAGS: -i
 
 all: dependency other
 
Index: src/usr.bin/make/unit-tests/opt-keep-going.mk
diff -u src/usr.bin/make/unit-tests/opt-keep-going.mk:1.4 src/usr.bin/make/unit-tests/opt-keep-going.mk:1.5
--- src/usr.bin/make/unit-tests/opt-keep-going.mk:1.4	Sun Oct 18 18:12:42 2020
+++ src/usr.bin/make/unit-tests/opt-keep-going.mk	Mon Nov  9 20:50:56 2020
@@ -1,10 +1,11 @@
-# $NetBSD: opt-keep-going.mk,v 1.4 2020/10/18 18:12:42 rillig Exp $
+# $NetBSD: opt-keep-going.mk,v 1.5 2020/11/09 20:50:56 rillig Exp $
 #
 # Tests for the -k command line option, which stops building a target as soon
 # as an error is detected, but continues building the other, independent
 # targets, as far as possible.
 
 .MAKEFLAGS: -d0			# switch stdout to being line-buffered
+.MAKEFLAGS: -k
 
 all: dependency other
 

Index: src/usr.bin/make/unit-tests/opt-warnings-as-errors.exp
diff -u src/usr.bin/make/unit-tests/opt-warnings-as-errors.exp:1.2 src/usr.bin/make/unit-tests/opt-warnings-as-errors.exp:1.3
--- src/usr.bin/make/unit-tests/opt-warnings-as-errors.exp:1.2	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-warnings-as-errors.exp	Mon Nov  9 20:50:56 2020
@@ -1,6 +1,6 @@
-make: "opt-warnings-as-errors.mk" line 5: warning: message 1
+make: "opt-warnings-as-errors.mk" line 7: warning: message 1
 make: parsing warnings being treated as errors
-make: "opt-warnings-as-errors.mk" line 6: warning: message 2
+make: "opt-warnings-as-errors.mk" line 8: warning: message 2
 parsing continues
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/recursive.exp
diff -u src/usr.bin/make/unit-tests/recursive.exp:1.2 src/usr.bin/make/unit-tests/recursive.exp:1.3
--- src/usr.bin/make/unit-tests/recursive.exp:1.2	Thu Aug  6 16:09:33 2020
+++ src/usr.bin/make/unit-tests/recursive.exp	Mon Nov  9 20:50:56 2020
@@ -1,5 +1,5 @@
-make: "recursive.mk" line 34: Unclosed variable "MISSING_PAREN"
-make: "recursive.mk" line 35: Unclosed variable "MISSING_BRACE"
+make: "recursive.mk" line 36: Unclosed variable "MISSING_PAREN"
+make: "recursive.mk" line 37: Unclosed variable "MISSING_BRACE"
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/order.mk
diff -u src/usr.bin/make/unit-tests/order.mk:1.1 src/usr.bin/make/unit-tests/order.mk:1.2
--- src/usr.bin/make/unit-tests/order.mk:1.1	Thu Aug 21 13:44:51 2014
+++ src/usr.bin/make/unit-tests/order.mk	Mon Nov  9 20:50:56 2020
@@ -1,10 +1,12 @@
-# $NetBSD: order.mk,v 1.1 2014/08/21 13:44:51 apb Exp $
+# $NetBSD: order.mk,v 1.2 2020/11/09 20:50:56 rillig Exp $
 
 # Test that .ORDER is handled correctly.
 # The explicit dependency the.o: the.h will make us examine the.h
 # the .ORDER will prevent us building it immediately,
 # we should then examine the.c rather than stop.
 
+.MAKEFLAGS: -j1
+
 all: the.o
 
 .ORDER: the.c the.h

Reply via email to