Sat Nov 7 00:07:03 2020 UTC ()
make(1): fix references to Var_SetWithFlags in tests


(rillig)
diff -r1.1 -r1.2 src/usr.bin/make/unit-tests/archive-suffix.mk
diff -r1.27 -r1.28 src/usr.bin/make/unit-tests/varmisc.mk

cvs diff -r1.1 -r1.2 src/usr.bin/make/unit-tests/archive-suffix.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/archive-suffix.mk 2020/08/29 14:47:26 1.1
+++ src/usr.bin/make/unit-tests/archive-suffix.mk 2020/11/07 00:07:02 1.2
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: archive-suffix.mk,v 1.1 2020/08/29 14:47:26 rillig Exp $ 1# $NetBSD: archive-suffix.mk,v 1.2 2020/11/07 00:07:02 rillig Exp $
2# 2#
3# Between 2020-08-23 and 2020-08-30, the below code produced an assertion 3# Between 2020-08-23 and 2020-08-30, the below code produced an assertion
4# failure in Var_Set_with_flags, triggered by Compat_Make, when setting the 4# failure in Var_SetWithFlags, triggered by Compat_Make, when setting the
5# .IMPSRC of an archive node to its .TARGET. 5# .IMPSRC of an archive node to its .TARGET.
6# 6#
7# The code assumed that the .TARGET variable of every node would be set, but 7# The code assumed that the .TARGET variable of every node would be set, but
8# but that is not guaranteed. 8# but that is not guaranteed.
9# 9#
10# Between 2016-03-15 and 2016-03-16 the behavior of the below code changed. 10# Between 2016-03-15 and 2016-03-16 the behavior of the below code changed.
11# Until 2016-03-15, it remade the target, starting with 2016-03-16 it says 11# Until 2016-03-15, it remade the target, starting with 2016-03-16 it says
12# "`all' is up to date". 12# "`all' is up to date".
13 13
14.SUFFIXES: 14.SUFFIXES:
15.SUFFIXES: .c .o 15.SUFFIXES: .c .o
16 16
17all: lib.a(obj1.o) 17all: lib.a(obj1.o)

cvs diff -r1.27 -r1.28 src/usr.bin/make/unit-tests/varmisc.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmisc.mk 2020/11/06 23:11:11 1.27
+++ src/usr.bin/make/unit-tests/varmisc.mk 2020/11/07 00:07:02 1.28
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: varmisc.mk,v 1.27 2020/11/06 23:11:11 rillig Exp $ 1# $NetBSD: varmisc.mk,v 1.28 2020/11/07 00:07:02 rillig Exp $
2# 2#
3# Miscellaneous variable tests. 3# Miscellaneous variable tests.
4 4
5all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \ 5all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \
6 strftime cmpv manok 6 strftime cmpv manok
7all: save-dollars 7all: save-dollars
8all: export-appended 8all: export-appended
9all: parse-dynamic 9all: parse-dynamic
10all: varerror-unclosed 10all: varerror-unclosed
11 11
12unmatched_var_paren: 12unmatched_var_paren:
13 @echo ${foo::=foo-text} 13 @echo ${foo::=foo-text}
14 14
@@ -77,27 +77,27 @@ MAN+= ${MAN$s} @@ -77,27 +77,27 @@ MAN+= ${MAN$s}
77manok: 77manok:
78 @echo MAN=${MAN} 78 @echo MAN=${MAN}
79 79
80# This is an expanded variant of the above .for loop. 80# This is an expanded variant of the above .for loop.
81# Between 2020-06-28 and 2020-07-02 this paragraph generated a wrong 81# Between 2020-06-28 and 2020-07-02 this paragraph generated a wrong
82# error message "Variable VARNAME is recursive". 82# error message "Variable VARNAME is recursive".
83# When evaluating the !empty expression, the ${:U1} was not expanded and 83# When evaluating the !empty expression, the ${:U1} was not expanded and
84# thus resulted in the seeming definition VARNAME=${VARNAME}, which is 84# thus resulted in the seeming definition VARNAME=${VARNAME}, which is
85# obviously recursive. 85# obviously recursive.
86VARNAME= ${VARNAME${:U1}} 86VARNAME= ${VARNAME${:U1}}
87.if defined(VARNAME${:U2}) && !empty(VARNAME${:U2}) 87.if defined(VARNAME${:U2}) && !empty(VARNAME${:U2})
88.endif 88.endif
89 89
90# begin .MAKE.SAVE_DOLLARS; see Var_Set_with_flags and ParseBoolean. 90# begin .MAKE.SAVE_DOLLARS; see Var_SetWithFlags and ParseBoolean.
91SD_VALUES= 0 1 2 False True false true Yes No yes no On Off ON OFF on off 91SD_VALUES= 0 1 2 False True false true Yes No yes no On Off ON OFF on off
92SD_4_DOLLARS= $$$$ 92SD_4_DOLLARS= $$$$
93 93
94.for val in ${SD_VALUES} 94.for val in ${SD_VALUES}
95.MAKE.SAVE_DOLLARS:= ${val} # Must be := since a simple = has no effect. 95.MAKE.SAVE_DOLLARS:= ${val} # Must be := since a simple = has no effect.
96SD.${val}:= ${SD_4_DOLLARS} 96SD.${val}:= ${SD_4_DOLLARS}
97.endfor 97.endfor
98.MAKE.SAVE_DOLLARS:= yes 98.MAKE.SAVE_DOLLARS:= yes
99 99
100save-dollars: 100save-dollars:
101.for val in ${SD_VALUES} 101.for val in ${SD_VALUES}
102 @printf '%s: %-8s = %s\n' $@ ${val} ${SD.${val}:Q} 102 @printf '%s: %-8s = %s\n' $@ ${val} ${SD.${val}:Q}
103.endfor 103.endfor