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): separate sections of moderr...
details: https://anonhg.NetBSD.org/src/rev/a8ab60a54c5c
branches: trunk
changeset: 1015788:a8ab60a54c5c
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Nov 01 10:46:34 2020 +0000
description:
make(1): separate sections of moderrs.mk with empty lines
diffstat:
usr.bin/make/unit-tests/moderrs.exp | 17 +++++++++++++++
usr.bin/make/unit-tests/moderrs.mk | 40 +++++++++++++++++++-----------------
2 files changed, 38 insertions(+), 19 deletions(-)
diffs (250 lines):
diff -r 875a2f655c29 -r a8ab60a54c5c usr.bin/make/unit-tests/moderrs.exp
--- a/usr.bin/make/unit-tests/moderrs.exp Sun Nov 01 10:12:38 2020 +0000
+++ b/usr.bin/make/unit-tests/moderrs.exp Sun Nov 01 10:46:34 2020 +0000
@@ -2,22 +2,27 @@
Expect: Unknown modifier 'Z'
make: Unknown modifier 'Z'
VAR:Z=
+
modunknV:
Expect: Unknown modifier 'Z'
make: Unknown modifier 'Z'
VAR:Z=
+
varterm:
Expect: Unclosed variable specification for VAR
make: Unclosed variable specification (expecting '}') for "VAR" (value "Thevariable") modifier S
VAR:S,V,v,=Thevariable
+
vartermV:
Expect: Unclosed variable specification for VAR
make: Unclosed variable specification after complex modifier (expecting '}') for VAR
VAR:S,V,v,=Thevariable
+
modtermV:
Expect: Unfinished modifier for VAR (',' missing)
make: Unfinished modifier for VAR (',' missing)
VAR:S,V,v=
+
modloop:
Expect: 2 errors about missing @ delimiter
make: Unfinished modifier for UNDEF ('@' missing)
@@ -25,10 +30,12 @@
make: Unfinished modifier for UNDEF ('@' missing)
1 2 3
+
modloop-close:
make: Unclosed variable specification (expecting '}') for "UNDEF" (value "1}... 2}... 3}...") modifier @
1}... 2}... 3}...
1}... 2}... 3}...
+
modwords:
Expect: 2 errors about missing ] delimiter
make: Unfinished modifier for UNDEF (']' missing)
@@ -37,12 +44,14 @@
13=
12345=ok
+
modexclam:
Expect: 2 errors about missing ! delimiter
make: Unfinished modifier for VARNAME ('!' missing)
make: Unfinished modifier for ! ('!' missing)
+
mod-subst-delimiter:
make: Missing delimiter for :S modifier
@@ -70,6 +79,7 @@
make: Unclosed variable specification (expecting '}') for "VAR" (value "TheVariable") modifier S
TheVariable
TheVariable
+
mod-regex-delimiter:
make: Missing delimiter for :C modifier
@@ -97,6 +107,7 @@
make: Unclosed variable specification (expecting '}') for "VAR" (value "TheVariable") modifier C
TheVariable
TheVariable
+
mod-regex-undefined-subexpression:
one one 2 3 5 8 one3 2one 34
make: No match for subexpression \2
@@ -105,6 +116,7 @@
make: No match for subexpression \2
make: No match for subexpression \1
()+() ()+() ()+() 3 5 8 (3)+() ()+(1) 34
+
mod-ts-parse:
112358132134
15152535558513521534
@@ -112,6 +124,7 @@
65oct}
make: Bad modifier `:tsxy' for FIB
xy}
+
mod-t-parse:
make: Bad modifier `:t' for FIB
@@ -121,6 +134,7 @@
make: Bad modifier `:t' for FIB
M*}
+
mod-ifelse-parse:
make: Unfinished modifier for FIB (':' missing)
@@ -131,10 +145,12 @@
make: Unfinished modifier for FIB ('}' missing)
then
+
mod-remember-parse:
1 1 2 3 5 8 13 21 34
make: Unknown modifier '_'
+
mod-sysv-parse:
make: Unknown modifier '3'
make: Unclosed variable specification (expecting '}') for "FIB" (value "") modifier 3
@@ -146,4 +162,5 @@
make: Unclosed variable specification (expecting '}') for "FIB" (value "") modifier 3
1 1 2 x3 5 8 1x3 21 34
+
exit status 0
diff -r 875a2f655c29 -r a8ab60a54c5c usr.bin/make/unit-tests/moderrs.mk
--- a/usr.bin/make/unit-tests/moderrs.mk Sun Nov 01 10:12:38 2020 +0000
+++ b/usr.bin/make/unit-tests/moderrs.mk Sun Nov 01 10:46:34 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: moderrs.mk,v 1.18 2020/11/01 10:12:38 rillig Exp $
+# $NetBSD: moderrs.mk,v 1.19 2020/11/01 10:46:34 rillig Exp $
#
# various modifier error tests
@@ -23,27 +23,27 @@
all: mod-remember-parse
all: mod-sysv-parse
-modunkn: print-name
+modunkn: print-header print-footer
@echo "Expect: Unknown modifier 'Z'"
@echo "VAR:Z=${VAR:Z}"
-modunknV: print-name
+modunknV: print-header print-footer
@echo "Expect: Unknown modifier 'Z'"
@echo "VAR:${MOD_UNKN}=${VAR:${MOD_UNKN}}"
-varterm: print-name
+varterm: print-header print-footer
@echo "Expect: Unclosed variable specification for VAR"
@echo VAR:S,V,v,=${VAR:S,V,v,
-vartermV: print-name
+vartermV: print-header print-footer
@echo "Expect: Unclosed variable specification for VAR"
@echo VAR:${MOD_TERM},=${VAR:${MOD_S}
-modtermV: print-name
+modtermV: print-header print-footer
@echo "Expect: Unfinished modifier for VAR (',' missing)"
-@echo "VAR:${MOD_TERM}=${VAR:${MOD_TERM}}"
-modloop: print-name
+modloop: print-header print-footer
@echo "Expect: 2 errors about missing @ delimiter"
@echo ${UNDEF:U1 2 3:@var}
@echo ${UNDEF:U1 2 3:@var@...}
@@ -55,11 +55,11 @@
# braces must be balanced.
# This is also contrary to the SysV modifier, where only the actually
# used delimiter (either braces or parentheses) must be balanced.
-modloop-close: print-name
+modloop-close: print-header print-footer
@echo ${UNDEF:U1 2 3:@var@${var}}...@
@echo ${UNDEF:U1 2 3:@var@${var}}...@}
-modwords: print-name
+modwords: print-header print-footer
@echo "Expect: 2 errors about missing ] delimiter"
@echo ${UNDEF:U1 2 3:[}
@echo ${UNDEF:U1 2 3:[#}
@@ -80,7 +80,7 @@
# which is empty.
@echo 12345=${UNDEF:U1 2 3:[123451234512345123451234512345]:S,^$,ok,:S,^3$,ok,}
-modexclam: print-name
+modexclam: print-header print-footer
@echo "Expect: 2 errors about missing ! delimiter"
@echo ${VARNAME:!echo}
# When the final exclamation mark is missing, there is no
@@ -89,7 +89,7 @@
# and the above would have produced an "Unknown modifier '!'".
@echo ${!:L:!=exclam}
-mod-subst-delimiter: print-name
+mod-subst-delimiter: print-header print-footer
@echo ${VAR:S
@echo ${VAR:S,
@echo ${VAR:S,from
@@ -105,7 +105,7 @@
@echo ${VAR:S,from,to,
@echo ${VAR:S,from,to,}
-mod-regex-delimiter: print-name
+mod-regex-delimiter: print-header print-footer
@echo ${VAR:C
@echo ${VAR:C,
@echo ${VAR:C,from
@@ -133,38 +133,40 @@
# mod-subst-chain). Luckily the modifier :U does not make sense after :C,
# therefore this case does not happen in practice.
# The sub-modifier for the :C modifier would have to be chosen wisely.
-mod-regex-undefined-subexpression: print-name
+mod-regex-undefined-subexpression: print-header print-footer
@echo ${FIB:C,1(.*),one\1,} # all ok
@echo ${FIB:C,1(.*)|2(.*),(\1)+(\2),:Q} # no match for subexpression
-mod-ts-parse: print-name
+mod-ts-parse: print-header print-footer
@echo ${FIB:ts}
@echo ${FIB:ts\65} # octal 065 == U+0035 == '5'
@echo ${FIB:ts\65oct} # bad modifier
@echo ${FIB:tsxy} # modifier too long
-mod-t-parse: print-name
+mod-t-parse: print-header print-footer
@echo ${FIB:t
@echo ${FIB:txy}
@echo ${FIB:t}
@echo ${FIB:t:M*}
-mod-ifelse-parse: print-name
+mod-ifelse-parse: print-header print-footer
@echo ${FIB:?
@echo ${FIB:?then
@echo ${FIB:?then:
@echo ${FIB:?then:else
@echo ${FIB:?then:else}
-mod-remember-parse: print-name
+mod-remember-parse: print-header print-footer
@echo ${FIB:_} # ok
@echo ${FIB:__} # modifier name too long
-mod-sysv-parse: print-name
+mod-sysv-parse: print-header print-footer
@echo ${FIB:3
@echo ${FIB:3=
@echo ${FIB:3=x3
@echo ${FIB:3=x3} # ok
-print-name: .USEBEFORE
+print-header: .USEBEFORE
@echo $@:
+print-footer: .USE
+ @echo
Home |
Main Index |
Thread Index |
Old Index