Module Name:    src
Committed By:   rillig
Date:           Thu Oct 29 18:38:24 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: vardebug.exp vardebug.mk

Log Message:
make(1): add test for ignoring assignment to read-only variable


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/vardebug.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/vardebug.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/vardebug.exp
diff -u src/usr.bin/make/unit-tests/vardebug.exp:1.10 src/usr.bin/make/unit-tests/vardebug.exp:1.11
--- src/usr.bin/make/unit-tests/vardebug.exp:1.10	Thu Oct 29 18:19:41 2020
+++ src/usr.bin/make/unit-tests/vardebug.exp	Thu Oct 29 18:38:24 2020
@@ -78,6 +78,9 @@ Result of ${:unknown} is error (VARE_UND
 make: "vardebug.mk" line 44: Malformed conditional (${:Uvariable:unknown})
 Var_Parse: ${UNDEFINED} with VARE_UNDEFERR|VARE_WANTRES
 make: "vardebug.mk" line 53: Malformed conditional (${UNDEFINED})
+Global:delete .SHELL (not found)
+Command:.SHELL = /bin/sh
+Command:.SHELL = overwritten ignored (read-only)
 Global:.MAKEFLAGS =  -r -k -d v -d
 Global:.MAKEFLAGS =  -r -k -d v -d 0
 make: Fatal errors encountered -- cannot continue

Index: src/usr.bin/make/unit-tests/vardebug.mk
diff -u src/usr.bin/make/unit-tests/vardebug.mk:1.4 src/usr.bin/make/unit-tests/vardebug.mk:1.5
--- src/usr.bin/make/unit-tests/vardebug.mk:1.4	Thu Oct 29 18:19:41 2020
+++ src/usr.bin/make/unit-tests/vardebug.mk	Thu Oct 29 18:38:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: vardebug.mk,v 1.4 2020/10/29 18:19:41 rillig Exp $
+# $NetBSD: vardebug.mk,v 1.5 2020/10/29 18:38:24 rillig Exp $
 #
 # Demonstrates the debugging output for var.c.
 
@@ -53,6 +53,11 @@ VAR+=		3
 .if ${UNDEFINED}
 .endif
 
+# By default, .SHELL is not defined and thus can be set.  As soon as it is
+# accessed, it is initialized in the command line context (during VarFind),
+# where it is set to read-only.  Assigning to it is ignored.
+.MAKEFLAGS: .SHELL=overwritten
+
 .MAKEFLAGS: -d0
 
 all:

Reply via email to