Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): add coverage test for dynam...



details:   https://anonhg.NetBSD.org/src/rev/d66efd5b4a97
branches:  trunk
changeset: 936436:d66efd5b4a97
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 26 21:46:10 2020 +0000

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

diffstat:

 usr.bin/make/unit-tests/varmisc.exp |   2 ++
 usr.bin/make/unit-tests/varmisc.mk  |  29 ++++++++++++++++++++++-------
 2 files changed, 24 insertions(+), 7 deletions(-)

diffs (59 lines):

diff -r c2dac09fec08 -r d66efd5b4a97 usr.bin/make/unit-tests/varmisc.exp
--- a/usr.bin/make/unit-tests/varmisc.exp       Sun Jul 26 21:31:11 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.exp       Sun Jul 26 21:46:10 2020 +0000
@@ -44,6 +44,8 @@
 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
diff -r c2dac09fec08 -r d66efd5b4a97 usr.bin/make/unit-tests/varmisc.mk
--- a/usr.bin/make/unit-tests/varmisc.mk        Sun Jul 26 21:31:11 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.mk        Sun Jul 26 21:46:10 2020 +0000
@@ -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 @@
 # 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.



Home | Main Index | Thread Index | Old Index