Module Name:    src
Committed By:   sjg
Date:           Fri Mar  1 20:15:59 UTC 2024

Modified Files:
        src/usr.bin/make/unit-tests: var-scope-local.exp var-scope-local.mk

Log Message:
make: update var-scope-local test

Show what VAR value is in environment of target script.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/var-scope-local.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/var-scope-local.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/var-scope-local.exp
diff -u src/usr.bin/make/unit-tests/var-scope-local.exp:1.7 src/usr.bin/make/unit-tests/var-scope-local.exp:1.8
--- src/usr.bin/make/unit-tests/var-scope-local.exp:1.7	Wed Dec 20 09:03:09 2023
+++ src/usr.bin/make/unit-tests/var-scope-local.exp	Fri Mar  1 20:15:59 2024
@@ -61,11 +61,18 @@ dir/subdir/inference-rule-chain.ir-to: *
 : Making var-scope-local.o from var-scope-local.c.
 : Making basename "var-scope-local.o" in "." from "var-scope-local.c" in ".".
 : Making var-scope-local-assign.o with VAR="local".
+var-scope-local-assign.o env has VAR='local'
 : Making var-scope-local-append.o with VAR="local to var-scope-local-append.o".
+var-scope-local-append.o env has VAR='local to var-scope-local-append.o'
 : Making var-scope-local-append-global.o with VAR="global+local".
+var-scope-local-append-global.o env has VAR='global+local'
 : Making var-scope-local-default.o with VAR="global".
+var-scope-local-default.o env has VAR='global'
 : Making var-scope-local-subst.o with VAR="global+local".
+var-scope-local-subst.o env has VAR='global+local'
 : Making var-scope-local-shell.o with VAR="output".
+var-scope-local-shell.o env has VAR='output'
 : var-scope-local-use.o uses .USE VAR="global"
+var-scope-local-use.o env has VAR='global'
 : all overwritten
 exit status 0

Index: src/usr.bin/make/unit-tests/var-scope-local.mk
diff -u src/usr.bin/make/unit-tests/var-scope-local.mk:1.9 src/usr.bin/make/unit-tests/var-scope-local.mk:1.10
--- src/usr.bin/make/unit-tests/var-scope-local.mk:1.9	Wed Dec 20 09:03:09 2023
+++ src/usr.bin/make/unit-tests/var-scope-local.mk	Fri Mar  1 20:15:59 2024
@@ -1,4 +1,4 @@
-# $NetBSD: var-scope-local.mk,v 1.9 2023/12/20 09:03:09 rillig Exp $
+# $NetBSD: var-scope-local.mk,v 1.10 2024/03/01 20:15:59 sjg Exp $
 #
 # Tests for target-local variables, such as ${.TARGET} or $@.  These variables
 # are relatively short-lived as they are created just before making the
@@ -200,12 +200,14 @@ var-scope-local-default.o \
 var-scope-local-subst.o \
 var-scope-local-shell.o:
 	: Making ${.TARGET} with VAR="${VAR}".
+	@echo "${.TARGET} env has VAR='$$VAR'"
 
 # Target-local variables are enabled by default.  Force them to be enabled
 # just in case a test above has disabled them.
 .MAKE.TARGET_LOCAL_VARIABLES= yes
 
 VAR=	global
+.export VAR
 
 # If the sources of a dependency line look like a variable assignment, make
 # treats them as such.  There is only a single variable assignment per
@@ -264,6 +266,7 @@ var-scope-local-shell.o: VAR != echo out
 # expect: : var-scope-local-use.o uses .USE VAR="global"
 a_use: .USE VAR=use
 	: ${.TARGET} uses .USE VAR="${VAR}"
+	@echo "${.TARGET} env has VAR='$$VAR'"
 
 all: var-scope-local-use.o
 var-scope-local-use.o: a_use

Reply via email to