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

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

Log Message:
make(1): add test for .MAKE.SAVE_DOLLARS


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.11 -r1.12 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.8 src/usr.bin/make/unit-tests/varmisc.exp:1.9
--- src/usr.bin/make/unit-tests/varmisc.exp:1.8	Wed Jul  1 18:02:26 2020
+++ src/usr.bin/make/unit-tests/varmisc.exp	Sun Jul 26 10:48:21 2020
@@ -23,4 +23,21 @@ Version=123.456.789 == 123456789
 Literal=3.4.5 == 3004005
 We have target specific vars
 MAN= make.1
+save-dollars: 0        = $
+save-dollars: 1        = $$
+save-dollars: 2        = $$
+save-dollars: False    = $
+save-dollars: True     = $$
+save-dollars: false    = $
+save-dollars: true     = $$
+save-dollars: Yes      = $$
+save-dollars: No       = $
+save-dollars: yes      = $$
+save-dollars: no       = $
+save-dollars: On       = $$
+save-dollars: Off      = $
+save-dollars: ON       = $$
+save-dollars: OFF      = $
+save-dollars: on       = $$
+save-dollars: off      = $
 exit status 0

Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.11 src/usr.bin/make/unit-tests/varmisc.mk:1.12
--- src/usr.bin/make/unit-tests/varmisc.mk:1.11	Sun Jul 19 20:37:57 2020
+++ src/usr.bin/make/unit-tests/varmisc.mk	Sun Jul 26 10:48:21 2020
@@ -1,9 +1,10 @@
-# $Id: varmisc.mk,v 1.11 2020/07/19 20:37:57 rillig Exp $
+# $Id: varmisc.mk,v 1.12 2020/07/26 10:48:21 rillig Exp $
 #
 # Miscellaneous variable tests.
 
 all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \
 	strftime cmpv manok
+all: save-dollars
 
 unmatched_var_paren:
 	@echo ${foo::=foo-text}
@@ -82,3 +83,18 @@ manok:
 VARNAME=	${VARNAME${:U1}}
 .if defined(VARNAME${:U2}) && !empty(VARNAME${:U2})
 .endif
+
+# begin .MAKE.SAVE_DOLLARS; see Var_Set_with_flags and s2Boolean.
+SD_VALUES=	0 1 2 False True false true Yes No yes no On Off ON OFF on off
+SD_4_DOLLARS=	$$$$
+
+.for val in ${SD_VALUES}
+.MAKE.SAVE_DOLLARS:=	${val}	# Must be := since a simple = has no effect.
+SD.${val}:=		${SD_4_DOLLARS}
+.endfor
+.MAKE.SAVE_DOLLARS:=	yes
+
+save-dollars:
+.for val in ${SD_VALUES}
+	@printf '%s: %-8s = %s\n' $@ ${val} ${SD.${val}:Q}
+.endfor

Reply via email to