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 test for .MAKE.SAVE_DOL...



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

description:
make(1): add test for .MAKE.SAVE_DOLLARS

diffstat:

 usr.bin/make/unit-tests/varmisc.exp |  17 +++++++++++++++++
 usr.bin/make/unit-tests/varmisc.mk  |  18 +++++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletions(-)

diffs (59 lines):

diff -r f39d5a8c17ae -r 09d9aab66973 usr.bin/make/unit-tests/varmisc.exp
--- a/usr.bin/make/unit-tests/varmisc.exp       Sun Jul 26 10:11:04 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.exp       Sun Jul 26 10:48:21 2020 +0000
@@ -23,4 +23,21 @@
 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
diff -r f39d5a8c17ae -r 09d9aab66973 usr.bin/make/unit-tests/varmisc.mk
--- a/usr.bin/make/unit-tests/varmisc.mk        Sun Jul 26 10:11:04 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.mk        Sun Jul 26 10:48:21 2020 +0000
@@ -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 @@
 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



Home | Main Index | Thread Index | Old Index