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): use consistent test names i...



details:   https://anonhg.NetBSD.org/src/rev/2d646e1ca927
branches:  trunk
changeset: 936385:2d646e1ca927
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 26 11:39:55 2020 +0000

description:
make(1): use consistent test names in modmisc.mk

diffstat:

 usr.bin/make/unit-tests/modmisc.exp |  30 +++++++++++++++---------------
 usr.bin/make/unit-tests/modmisc.mk  |  36 ++++++++++++++++++++----------------
 2 files changed, 35 insertions(+), 31 deletions(-)

diffs (190 lines):

diff -r f3bf5c21628d -r 2d646e1ca927 usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp       Sun Jul 26 11:19:04 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp       Sun Jul 26 11:39:55 2020 +0000
@@ -17,14 +17,14 @@
 S:empty
 C:empty
 @:
-mod-S:
+mod-subst:
 :a b b c:
 :a b b c:
 : b c:
 :a c:
 :x__ 3 x__ 3:
 12345
-mod-C:
+mod-regex:
 :a b b c:
 :a b b c:
 : b c:
@@ -33,10 +33,10 @@
 :a c:
 :x__ 3 x__ 3:
 :+one+ +two+ +three+:
-mod-at-resolve:w1d2d3w w2i3w w1i2d3 2i${RES3}w w1d2d3 2i${RES3} 1i${RES2}w:
-mod-at-dollar:(1) (2) (3).
-mod-at-dollar:() () ().
-mod-at-dollar:() () ().
+mod-loop-resolve:w1d2d3w w2i3w w1i2d3 2i${RES3}w w1d2d3 2i${RES3} 1i${RES2}w:
+mod-loop-varname-dollar:(1) (2) (3).
+mod-loop-varname-dollar:() () ().
+mod-loop-varname-dollar:() () ().
 mod-subst-dollar:$1:
 mod-subst-dollar:$2:
 mod-subst-dollar:$3:
@@ -53,27 +53,27 @@
 mod-loop-dollar:$${word}$$:
 mod-loop-dollar:$$5$$:
 mod-loop-dollar:$$${word}$$$:
-mod-C-limits:00-ok:1 2323 45456
+mod-regex-limits:00-ok:1 2323 45456
 make: No subexpression \1
 make: No subexpression \1
 make: No subexpression \1
 make: No subexpression \1
-mod-C-limits:11-missing:1 6
-mod-C-limits:11-ok:1 22 446
+mod-regex-limits:11-missing:1 6
+mod-regex-limits:11-ok:1 22 446
 make: No subexpression \2
 make: No subexpression \2
 make: No subexpression \2
 make: No subexpression \2
-mod-C-limits:22-missing:1 6
+mod-regex-limits:22-missing:1 6
 make: No subexpression \2
 make: No subexpression \2
 make: No subexpression \2
 make: No subexpression \2
-mod-C-limits:22-missing:1 6
-mod-C-limits:22-ok:1 33 556
-mod-C-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest
+mod-regex-limits:22-missing:1 6
+mod-regex-limits:22-ok:1 33 556
+mod-regex-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest
 make: RE substitution error: (details omitted)
-mod-C-errors:
+mod-regex-errors:
 mod-assign: first=1.
 mod-assign: last=3.
 mod-assign: appended=1 2 3.
@@ -87,7 +87,7 @@
 mod-assign-nested: then3t3
 mod-assign-nested: else4e4
 mod-tu-space: A   B
-mod-Q: new
+mod-quote: new
 
 line
 mod-break-many-words: 500
diff -r f3bf5c21628d -r 2d646e1ca927 usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk        Sun Jul 26 11:19:04 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk        Sun Jul 26 11:39:55 2020 +0000
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.22 2020/07/25 20:35:35 rillig Exp $
+# $Id: modmisc.mk,v 1.23 2020/07/26 11:39:55 rillig Exp $
 #
 # miscellaneous modifier tests
 
@@ -16,19 +16,23 @@
 MOD_SEP=S,:, ,g
 
 all:   modvar modvarloop modsysv mod-HTE emptyvar undefvar
-all:   mod-S mod-C mod-at-varname mod-at-resolve mod-at-dollar
+all:   mod-subst
+all:   mod-regex
+all:   mod-loop-varname mod-loop-resolve mod-loop-varname-dollar
 all:   mod-subst-dollar mod-loop-dollar
-all:   mod-C-limits
-all:   mod-C-errors
+all:   mod-regex-limits
+all:   mod-regex-errors
 all:   mod-assign
 all:   mod-assign-nested
 all:   mod-tu-space
-all:   mod-Q
+all:   mod-quote
 all:   mod-break-many-words
 
+# See also sysv.mk.
 modsysv:
        @echo "The answer is ${libfoo.a:L:libfoo.a=42}"
 
+# Demonstrates modifiers that are given indirectly from a variable.
 modvar:
        @echo "path='${path}'"
        @echo "path='${path:${MOD_NODOT}}'"
@@ -68,7 +72,7 @@
        @echo C:${:U:C,^$,empty,}
        @echo @:${:U:@var@empty@}
 
-mod-S:
+mod-subst:
        @echo $@:
        @echo :${:Ua b b c:S,a b,,:Q}:
        @echo :${:Ua b b c:S,a b,,1:Q}:
@@ -77,7 +81,7 @@
        @echo :${:U1 2 3 1 2 3:S,1 2,___,Wg:S,_,x,:Q}:
        @echo ${:U12345:S,,sep,g:Q}
 
-mod-C:
+mod-regex:
        @echo $@:
        @echo :${:Ua b b c:C,a b,,:Q}:
        @echo :${:Ua b b c:C,a b,,1:Q}:
@@ -89,7 +93,7 @@
 # In the :@ modifier, the name of the loop variable can even be generated
 # dynamically.  There's no practical use-case for this, and hopefully nobody
 # will ever depend on this, but technically it's possible.
-mod-at-varname:
+mod-loop-varname:
        @echo :${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@:Q}:
 
 # The :@ modifier resolves the variables a little more often than expected.
@@ -102,13 +106,13 @@
 RES2=          2d${RES3} 2i$${RES3}
 RES3=          3
 
-mod-at-resolve:
+mod-loop-resolve:
        @echo $@:${RESOLVE:@v@w${v}w@:Q}:
 
-# As of 2020-07-19, the variable name of the :@ modifier may end with one
-# or two dollar signs, which are silently ignored.  There's no point in
-# allowing a dollar sign in that position.
-mod-at-dollar:
+# Until 2020-07-20, the variable name of the :@ modifier could end with one
+# or two dollar signs, which were silently ignored.
+# There's no point in allowing a dollar sign in that position.
+mod-loop-varname-dollar:
        @echo $@:${1 2 3:L:@v$@($v)@:Q}.
        @echo $@:${1 2 3:L:@v$$@($v)@:Q}.
        @echo $@:${1 2 3:L:@v$$$@($v)@:Q}.
@@ -144,7 +148,7 @@
        @echo $@:${:U5:@word@$$$$${word}$$$$$@:Q}:
        @echo $@:${:U6:@word@$$$$$${word}$$$$$$@:Q}:
 
-mod-C-limits:
+mod-regex-limits:
        @echo $@:00-ok:${:U1 23 456:C,..,\0\0,:Q}
        @echo $@:11-missing:${:U1 23 456:C,..,\1\1,:Q}
        @echo $@:11-ok:${:U1 23 456:C,(.).,\1\1,:Q}
@@ -155,7 +159,7 @@
        # which is more than enough for daily use.
        @echo $@:capture:${:UabcdefghijABCDEFGHIJrest:C,(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.),\9\8\7\6\5\4\3\2\1\0\10\11\12,}
 
-mod-C-errors:
+mod-regex-errors:
        @echo $@: ${UNDEF:Uvalue:C,[,,}
 
 # Just a bit of basic code coverage for the obscure ::= assignment modifiers.
@@ -182,7 +186,7 @@
        # the adjacent spaces are preserved.
        @echo $@: ${a   b:L:tu:Q}
 
-mod-Q:
+mod-quote:
        @echo $@: new${.newline:Q}${.newline:Q}line
 
 # Cover the bmake_realloc in brk_string.



Home | Main Index | Thread Index | Old Index