make(1): remove debug output from counter tests

Now that the tests work as intended, the debug information is no longer
necessary.  It was only intended to track down the cause of the
unexpected behavior.
This commit is contained in:
rillig 2020-09-23 07:54:08 +00:00
parent b289a7c0b8
commit 7a66810d3a
5 changed files with 3 additions and 143 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.147 2020/09/23 03:33:55 rillig Exp $
# $NetBSD: Makefile,v 1.148 2020/09/23 07:54:08 rillig Exp $
#
# Unit tests for make(1)
#
@ -397,9 +397,6 @@ SED_CMDS.varname-dot-shell+= -e 's,"/[^"]*","(details omitted)",'
SED_CMDS.varname-dot-shell+= -e 's,\[/[^]]*\],[(details omitted)],'
# Some tests need an additional round of postprocessing.
POSTPROC.counter= ${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p'
POSTPROC.counter-append= ${POSTPROC.counter}
POSTPROC.deptgt-suffixes= \
${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
POSTPROC.vardebug= ${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p'

View File

@ -1,67 +1,2 @@
Global:RELEVANT = yes (load-time part)
Global:COUNTER =
Global:NEXT = ${COUNTER::+=a}${COUNTER:[#]}
Global:A =
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
Var_Parse: ${COUNTER::+=a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER::...} to "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "a"
Global:COUNTER = a
Result of ${COUNTER::+=a} is "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER:[...} to " a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "1" (VARE_WANTRES|VARE_ASSIGN, none, none)
Global:A = 1
Global:B =
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
Var_Parse: ${COUNTER::+=a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER::...} to " a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "a"
Global:COUNTER = a a
Result of ${COUNTER::+=a} is "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER:[...} to " a a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "2" (VARE_WANTRES|VARE_ASSIGN, none, none)
Global:B = 2
Global:C =
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
Var_Parse: ${COUNTER::+=a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER::...} to " a a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "a"
Global:COUNTER = a a a
Result of ${COUNTER::+=a} is "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER:[...} to " a a a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "3" (VARE_WANTRES|VARE_ASSIGN, none, none)
Global:C = 3
Global:RELEVANT = no
Global:RELEVANT = yes (run-time part)
Result of ${RELEVANT::=yes (run-time part)} is "" (VARE_WANTRES, none, none)
Var_Parse: ${A:Q} B=${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${A:Q} to "1" (VARE_WANTRES, none, none)
QuoteMeta: [1]
Result of ${A:Q} is "1" (VARE_WANTRES, none, none)
Var_Parse: ${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${B:Q} to "2" (VARE_WANTRES, none, none)
QuoteMeta: [2]
Result of ${B:Q} is "2" (VARE_WANTRES, none, none)
Var_Parse: ${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${C:Q} to "3" (VARE_WANTRES, none, none)
QuoteMeta: [3]
Result of ${C:Q} is "3" (VARE_WANTRES, none, none)
Var_Parse: ${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${COUNTER:[...} to " a a a" (VARE_WANTRES, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "3" (VARE_WANTRES, none, none)
Applying ${COUNTER:Q} to "3" (VARE_WANTRES, none, none)
QuoteMeta: [3]
Result of ${COUNTER:Q} is "3" (VARE_WANTRES, none, none)
A=1 B=2 C=3 COUNTER=3
Var_Parse: ${RELEVANT::=no} with VARE_WANTRES
Applying ${RELEVANT::...} to "yes (run-time part)" (VARE_WANTRES, none, none)
Modifier part: "no"
Global:RELEVANT = no
exit status 0

View File

@ -1,4 +1,4 @@
# $NetBSD: counter-append.mk,v 1.2 2020/09/23 07:50:58 rillig Exp $
# $NetBSD: counter-append.mk,v 1.3 2020/09/23 07:54:08 rillig Exp $
#
# Demonstrates how to let make count the number of times a variable
# is actually accessed, using the ::+= variable modifier.
@ -6,8 +6,6 @@
# This works since 2020-09-23. Before that, the counter ended up at having
# 6 words, even though the NEXT variable was only accessed 3 times.
.MAKEFLAGS: -dv
RELEVANT= yes (load-time part) # just to filter the output
COUNTER= # zero

View File

@ -1,70 +1,2 @@
Global:RELEVANT = yes (load-time part)
Global:COUNTER =
Global:NEXT = ${COUNTER::=${COUNTER} a}${COUNTER:[#]}
Global:A =
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
Var_Parse: ${COUNTER::=${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER::...} to "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES
Modifier part: " a"
Global:COUNTER = a
Result of ${COUNTER::=${COUNTER} a} is "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER:[...} to " a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "1" (VARE_WANTRES|VARE_ASSIGN, none, none)
Global:A = 1
Global:B =
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
Var_Parse: ${COUNTER::=${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER::...} to " a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES
Modifier part: " a a"
Global:COUNTER = a a
Result of ${COUNTER::=${COUNTER} a} is "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER:[...} to " a a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "2" (VARE_WANTRES|VARE_ASSIGN, none, none)
Global:B = 2
Global:C =
Var_Parse: ${NEXT} with VARE_WANTRES|VARE_ASSIGN
Var_Parse: ${COUNTER::=${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER::...} to " a a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER} a}${COUNTER:[#]} with VARE_WANTRES
Modifier part: " a a a"
Global:COUNTER = a a a
Result of ${COUNTER::=${COUNTER} a} is "" (VARE_WANTRES|VARE_ASSIGN, none, none)
Var_Parse: ${COUNTER:[#]} with VARE_WANTRES|VARE_ASSIGN
Applying ${COUNTER:[...} to " a a a" (VARE_WANTRES|VARE_ASSIGN, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "3" (VARE_WANTRES|VARE_ASSIGN, none, none)
Global:C = 3
Global:RELEVANT = no
Global:RELEVANT = yes (run-time part)
Result of ${RELEVANT::=yes (run-time part)} is "" (VARE_WANTRES, none, none)
Var_Parse: ${A:Q} B=${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${A:Q} to "1" (VARE_WANTRES, none, none)
QuoteMeta: [1]
Result of ${A:Q} is "1" (VARE_WANTRES, none, none)
Var_Parse: ${B:Q} C=${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${B:Q} to "2" (VARE_WANTRES, none, none)
QuoteMeta: [2]
Result of ${B:Q} is "2" (VARE_WANTRES, none, none)
Var_Parse: ${C:Q} COUNTER=${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${C:Q} to "3" (VARE_WANTRES, none, none)
QuoteMeta: [3]
Result of ${C:Q} is "3" (VARE_WANTRES, none, none)
Var_Parse: ${COUNTER:[#]:Q} with VARE_WANTRES
Applying ${COUNTER:[...} to " a a a" (VARE_WANTRES, none, none)
Modifier part: "#"
Result of ${COUNTER:[#]} is "3" (VARE_WANTRES, none, none)
Applying ${COUNTER:Q} to "3" (VARE_WANTRES, none, none)
QuoteMeta: [3]
Result of ${COUNTER:Q} is "3" (VARE_WANTRES, none, none)
A=1 B=2 C=3 COUNTER=3
Var_Parse: ${RELEVANT::=no} with VARE_WANTRES
Applying ${RELEVANT::...} to "yes (run-time part)" (VARE_WANTRES, none, none)
Modifier part: "no"
Global:RELEVANT = no
exit status 0

View File

@ -1,4 +1,4 @@
# $NetBSD: counter.mk,v 1.3 2020/09/23 07:50:58 rillig Exp $
# $NetBSD: counter.mk,v 1.4 2020/09/23 07:54:08 rillig Exp $
#
# Demonstrates how to let make count the number of times a variable
# is actually accessed, using the ::= variable modifier.
@ -6,8 +6,6 @@
# This works since 2020-09-23. Before that, the counter ended up at having
# 4 words, even though the NEXT variable was only accessed 3 times.
.MAKEFLAGS: -dv
RELEVANT= yes (load-time part) # just to filter the output
COUNTER= # zero