Sun Nov 1 19:02:22 2020 UTC ()
make(1): move test flags to test varmod-match-escape.mk


(rillig)
diff -r1.180 -r1.181 src/usr.bin/make/unit-tests/Makefile
diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-match-escape.exp
diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-match-escape.mk

cvs diff -r1.180 -r1.181 src/usr.bin/make/unit-tests/Makefile (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/Makefile 2020/10/31 20:30:06 1.180
+++ src/usr.bin/make/unit-tests/Makefile 2020/11/01 19:02:22 1.181
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.180 2020/10/31 20:30:06 rillig Exp $ 1# $NetBSD: Makefile,v 1.181 2020/11/01 19:02:22 rillig Exp $
2# 2#
3# Unit tests for make(1) 3# Unit tests for make(1)
4# 4#
5# The main targets are: 5# The main targets are:
6# 6#
7# all: 7# all:
8# run all the tests 8# run all the tests
9# test: 9# test:
10# run 'all', and compare to expected results 10# run 'all', and compare to expected results
11# accept: 11# accept:
12# move generated output to expected results 12# move generated output to expected results
13# 13#
14# Settable variables 14# Settable variables
@@ -388,27 +388,26 @@ FLAGS.directive-ifmake= first second @@ -388,27 +388,26 @@ FLAGS.directive-ifmake= first second
388FLAGS.doterror= # none 388FLAGS.doterror= # none
389FLAGS.envfirst= -e 389FLAGS.envfirst= -e
390FLAGS.export= # none 390FLAGS.export= # none
391FLAGS.opt-ignore= -i 391FLAGS.opt-ignore= -i
392FLAGS.opt-keep-going= -k 392FLAGS.opt-keep-going= -k
393FLAGS.opt-no-action= -n 393FLAGS.opt-no-action= -n
394FLAGS.opt-query= -q 394FLAGS.opt-query= -q
395FLAGS.opt-var-expanded= -v VAR -v VALUE 395FLAGS.opt-var-expanded= -v VAR -v VALUE
396FLAGS.opt-var-literal= -V VAR -V VALUE 396FLAGS.opt-var-literal= -V VAR -V VALUE
397FLAGS.opt-warnings-as-errors= -W 397FLAGS.opt-warnings-as-errors= -W
398FLAGS.order= -j1 398FLAGS.order= -j1
399FLAGS.recursive= -dL 399FLAGS.recursive= -dL
400FLAGS.sh-leading-plus= -n 400FLAGS.sh-leading-plus= -n
401FLAGS.varmod-match-escape= -dv 
402FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmline-plain' 401FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmline-plain'
403 402
404# Some tests need extra postprocessing. 403# Some tests need extra postprocessing.
405SED_CMDS.job-output-long-lines= \ 404SED_CMDS.job-output-long-lines= \
406 ${:D Job separators on their own line are ok. } \ 405 ${:D Job separators on their own line are ok. } \
407 -e '/^--- job-[ab] ---$$/d' \ 406 -e '/^--- job-[ab] ---$$/d' \
408 ${:D Plain output lines are ok as well. } \ 407 ${:D Plain output lines are ok as well. } \
409 ${:D They may come in multiples of 1024 or as 10000. } \ 408 ${:D They may come in multiples of 1024 or as 10000. } \
410 -e '/^aa*$$/d' \ 409 -e '/^aa*$$/d' \
411 -e '/^bb*$$/d' \ 410 -e '/^bb*$$/d' \
412 ${:D The following lines should rather not occur since the job } \ 411 ${:D The following lines should rather not occur since the job } \
413 ${:D marker should always be at the beginning of the line. } \ 412 ${:D marker should always be at the beginning of the line. } \
414 -e '/^aa*--- job-b ---$$/d' \ 413 -e '/^aa*--- job-b ---$$/d' \
@@ -428,27 +427,26 @@ SED_CMDS.varmod-subst-regex+= \ @@ -428,27 +427,26 @@ SED_CMDS.varmod-subst-regex+= \
428 -e 's,\(Regex compilation error:\).*,\1 (details omitted),' 427 -e 's,\(Regex compilation error:\).*,\1 (details omitted),'
429SED_CMDS.varmod-edge+= -e 's, line [0-9]*:, line omitted:,' 428SED_CMDS.varmod-edge+= -e 's, line [0-9]*:, line omitted:,'
430SED_CMDS.varshell+= -e 's,^${.SHELL:T}: ,,' 429SED_CMDS.varshell+= -e 's,^${.SHELL:T}: ,,'
431SED_CMDS.varshell+= -e '/command/s,No such.*,not found,' 430SED_CMDS.varshell+= -e '/command/s,No such.*,not found,'
432SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,' 431SED_CMDS.varname-dot-parsedir= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,'
433SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,' 432SED_CMDS.varname-dot-parsefile= -e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,'
434SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g' 433SED_CMDS.varname-dot-shell= -e 's, = /[^ ]*, = (details omitted),g'
435SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g' 434SED_CMDS.varname-dot-shell+= -e 's,"/[^" ]*","(details omitted)",g'
436SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g' 435SED_CMDS.varname-dot-shell+= -e 's,\[/[^] ]*\],[(details omitted)],g'
437 436
438# Some tests need an additional round of postprocessing. 437# Some tests need an additional round of postprocessing.
439POSTPROC.deptgt-suffixes= \ 438POSTPROC.deptgt-suffixes= \
440 ${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p' 439 ${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
441POSTPROC.varmod-match-escape= ${TOOL_SED} -n -e '/^Pattern/p' 
442POSTPROC.varname= ${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p' 440POSTPROC.varname= ${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p'
443POSTPROC.varname-empty= ${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p' 441POSTPROC.varname-empty= ${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'
444 442
445# Some tests reuse other tests, which makes them unnecessarily fragile. 443# Some tests reuse other tests, which makes them unnecessarily fragile.
446export-all.rawout: export.mk 444export-all.rawout: export.mk
447unexport.rawout: export.mk 445unexport.rawout: export.mk
448unexport-env.rawout: export.mk 446unexport-env.rawout: export.mk
449 447
450# End of the configuration section. 448# End of the configuration section.
451 449
452.MAIN: all 450.MAIN: all
453 451
454UNIT_TESTS:= ${.PARSEDIR} 452UNIT_TESTS:= ${.PARSEDIR}

cvs diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-match-escape.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-match-escape.exp 2020/10/25 17:37:36 1.2
+++ src/usr.bin/make/unit-tests/varmod-match-escape.exp 2020/11/01 19:02:22 1.3
@@ -1,5 +1,29 @@ @@ -1,5 +1,29 @@
 1Var_Parse: ${SPECIALS:M${:U}\:} != ${SPECIALS:M\:${:U}} with VARE_UNDEFERR|VARE_WANTRES
 2Applying ${SPECIALS:M...} to "\: : \\ * \*" (VARE_UNDEFERR|VARE_WANTRES, none, none)
 3Var_Parse: ${:U}\: with VARE_UNDEFERR|VARE_WANTRES
 4Applying ${:U} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
 5Result of ${:U} is "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
1Pattern[SPECIALS] for [\: : \\ * \*] is [\:] 6Pattern[SPECIALS] for [\: : \\ * \*] is [\:]
 7ModifyWords: split "\: : \\ * \*" into 5 words
 8VarMatch [\:] [\:]
 9VarMatch [:] [\:]
 10VarMatch [\\] [\:]
 11VarMatch [*] [\:]
 12VarMatch [\*] [\:]
 13Result of ${SPECIALS:M${:U}\:} is ":" (VARE_UNDEFERR|VARE_WANTRES, none, none)
 14Var_Parse: ${SPECIALS:M\:${:U}} with VARE_UNDEFERR|VARE_WANTRES
 15Applying ${SPECIALS:M...} to "\: : \\ * \*" (VARE_UNDEFERR|VARE_WANTRES, none, none)
 16Var_Parse: ${:U} with VARE_UNDEFERR|VARE_WANTRES
 17Applying ${:U} to "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF)
 18Result of ${:U} is "" (VARE_UNDEFERR|VARE_WANTRES, none, VEF_UNDEF|VEF_DEF)
2Pattern[SPECIALS] for [\: : \\ * \*] is [:] 19Pattern[SPECIALS] for [\: : \\ * \*] is [:]
3Pattern[.MAKE.DEPENDFILE] for [.depend] is [/dev/null] 20ModifyWords: split "\: : \\ * \*" into 5 words
4Pattern[.MAKE.DEPENDFILE] for [.depend] is [no*] 21VarMatch [\:] [:]
 22VarMatch [:] [:]
 23VarMatch [\\] [:]
 24VarMatch [*] [:]
 25VarMatch [\*] [:]
 26Result of ${SPECIALS:M\:${:U}} is ":" (VARE_UNDEFERR|VARE_WANTRES, none, none)
 27Global:.MAKEFLAGS = -r -k -d v -d
 28Global:.MAKEFLAGS = -r -k -d v -d 0
5exit status 0 29exit status 0

cvs diff -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-match-escape.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/varmod-match-escape.mk 2020/10/24 08:46:08 1.2
+++ src/usr.bin/make/unit-tests/varmod-match-escape.mk 2020/11/01 19:02:22 1.3
@@ -1,20 +1,20 @@ @@ -1,20 +1,20 @@
1# $NetBSD: varmod-match-escape.mk,v 1.2 2020/10/24 08:46:08 rillig Exp $ 1# $NetBSD: varmod-match-escape.mk,v 1.3 2020/11/01 19:02:22 rillig Exp $
2# 2#
3# As of 2020-08-01, the :M and :N modifiers interpret backslashes differently, 3# As of 2020-08-01, the :M and :N modifiers interpret backslashes differently,
4# depending on whether there was a variable expression somewhere before the 4# depending on whether there was a variable expression somewhere before the
5# first backslash or not. See ApplyModifier_Match, "copy = TRUE". 5# first backslash or not. See ApplyModifier_Match, "copy = TRUE".
6# 6#
7# Apart from the different and possibly confusing debug output, there is no 7# Apart from the different and possibly confusing debug output, there is no
8# difference in behavior. When parsing the modifier text, only \{, \} and \: 8# difference in behavior. When parsing the modifier text, only \{, \} and \:
9# are unescaped, and in the pattern matching these have the same meaning as 9# are unescaped, and in the pattern matching these have the same meaning as
10# their plain variants '{', '}' and ':'. In the pattern matching from 10# their plain variants '{', '}' and ':'. In the pattern matching from
11# Str_Match, only \*, \? or \[ would make a noticeable difference. 11# Str_Match, only \*, \? or \[ would make a noticeable difference.
12SPECIALS= \: : \\ * \* 12SPECIALS= \: : \\ * \*
13RELEVANT= yes 13.MAKEFLAGS: -dv
14.if ${SPECIALS:M${:U}\:} != ${SPECIALS:M\:${:U}} 14.if ${SPECIALS:M${:U}\:} != ${SPECIALS:M\:${:U}}
15. warning unexpected 15. warning unexpected
16.endif 16.endif
17RELEVANT= no 17.MAKEFLAGS: -d0
18 18
19all: 19all:
20 @:; 20 @:;