Module Name:    src
Committed By:   rillig
Date:           Sun Jul 26 21:46:10 UTC 2020

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

Log Message:
make(1): add coverage test for dynamic = TRUE in Var_Parse


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/varmisc.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/varmisc.exp
diff -u src/usr.bin/make/unit-tests/varmisc.exp:1.12 src/usr.bin/make/unit-tests/varmisc.exp:1.13
--- src/usr.bin/make/unit-tests/varmisc.exp:1.12	Sun Jul 26 21:09:49 2020
+++ src/usr.bin/make/unit-tests/varmisc.exp	Sun Jul 26 21:46:10 2020
@@ -44,6 +44,8 @@ export-appended: env
 export-appended: env
 export-appended: env mk
 parse-dynamic: parse-dynamic parse-dynamic before
+parse-dynamic: parse-dynamic parse-dynamic after
+parse-dynamic: parse-dynamic parse-dynamic after
 varerror-unclosed:begin
 
 make: Unclosed variable specification (expecting '}') for "UNCLOSED" (value "") modifier M

Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.16 src/usr.bin/make/unit-tests/varmisc.mk:1.17
--- src/usr.bin/make/unit-tests/varmisc.mk:1.16	Sun Jul 26 21:09:49 2020
+++ src/usr.bin/make/unit-tests/varmisc.mk	Sun Jul 26 21:46:10 2020
@@ -1,4 +1,4 @@
-# $Id: varmisc.mk,v 1.16 2020/07/26 21:09:49 rillig Exp $
+# $Id: varmisc.mk,v 1.17 2020/07/26 21:46:10 rillig Exp $
 #
 # Miscellaneous variable tests.
 
@@ -165,16 +165,31 @@ export-appended:
 # the global context. They are preserved until there is a local context
 # in which resolving them makes sense.
 
+# There are different code paths for short names ...
 ${:U>}=		before
-G_TARGET:=	$@
-G_MEMBER:=	$%
-G_PREFIX:=	$*
-G_ARCHIVE:=	$!
-G_ALLSRC:=	$>
+GS_TARGET:=	$@
+GS_MEMBER:=	$%
+GS_PREFIX:=	$*
+GS_ARCHIVE:=	$!
+GS_ALLSRC:=	$>
 ${:U>}=		after
+# ... and for braced short names ...
+GB_TARGET:=	${@}
+GB_MEMBER:=	${%}
+GB_PREFIX:=	${*}
+GB_ARCHIVE:=	${!}
+GB_ALLSRC:=	${>}
+# ... and for long names.
+GL_TARGET:=	${.TARGET}
+GL_MEMBER:=	${.MEMBER}
+GL_PREFIX:=	${.PREFIX}
+GL_ARCHIVE:=	${.ARCHIVE}
+GL_ALLSRC:=	${.ALLSRC}
 
 parse-dynamic:
-	@echo $@: ${G_TARGET} ${G_MEMBER} ${G_PREFIX} ${G_ARCHIVE} ${G_ALLSRC}
+	@echo $@: ${GS_TARGET} ${GS_MEMBER} ${GS_PREFIX} ${GS_ARCHIVE} ${GS_ALLSRC}
+	@echo $@: ${GB_TARGET} ${GB_MEMBER} ${GB_PREFIX} ${GB_ARCHIVE} ${GB_ALLSRC}
+	@echo $@: ${GL_TARGET} ${GL_MEMBER} ${GL_PREFIX} ${GL_ARCHIVE} ${GL_ALLSRC}
 
 # As of 2020-07-26, make does not complain about unclosed variables.
 # It does complain about unclosed variables when parsing modifiers though.

Reply via email to