Module Name: src Committed By: rillig Date: Wed Sep 23 07:54:08 UTC 2020
Modified Files: src/usr.bin/make/unit-tests: Makefile counter-append.exp counter-append.mk counter.exp counter.mk Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/usr.bin/make/unit-tests/Makefile cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/counter-append.exp \ src/usr.bin/make/unit-tests/counter-append.mk cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/counter.exp cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/counter.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/make/unit-tests/Makefile diff -u src/usr.bin/make/unit-tests/Makefile:1.147 src/usr.bin/make/unit-tests/Makefile:1.148 --- src/usr.bin/make/unit-tests/Makefile:1.147 Wed Sep 23 03:33:55 2020 +++ src/usr.bin/make/unit-tests/Makefile Wed Sep 23 07:54:08 2020 @@ -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,"/[^" 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' Index: src/usr.bin/make/unit-tests/counter-append.exp diff -u src/usr.bin/make/unit-tests/counter-append.exp:1.2 src/usr.bin/make/unit-tests/counter-append.exp:1.3 --- src/usr.bin/make/unit-tests/counter-append.exp:1.2 Wed Sep 23 07:50:58 2020 +++ src/usr.bin/make/unit-tests/counter-append.exp Wed Sep 23 07:54:08 2020 @@ -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 Index: src/usr.bin/make/unit-tests/counter-append.mk diff -u src/usr.bin/make/unit-tests/counter-append.mk:1.2 src/usr.bin/make/unit-tests/counter-append.mk:1.3 --- src/usr.bin/make/unit-tests/counter-append.mk:1.2 Wed Sep 23 07:50:58 2020 +++ src/usr.bin/make/unit-tests/counter-append.mk Wed Sep 23 07:54:08 2020 @@ -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 Index: src/usr.bin/make/unit-tests/counter.exp diff -u src/usr.bin/make/unit-tests/counter.exp:1.7 src/usr.bin/make/unit-tests/counter.exp:1.8 --- src/usr.bin/make/unit-tests/counter.exp:1.7 Wed Sep 23 07:50:58 2020 +++ src/usr.bin/make/unit-tests/counter.exp Wed Sep 23 07:54:08 2020 @@ -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 Index: src/usr.bin/make/unit-tests/counter.mk diff -u src/usr.bin/make/unit-tests/counter.mk:1.3 src/usr.bin/make/unit-tests/counter.mk:1.4 --- src/usr.bin/make/unit-tests/counter.mk:1.3 Wed Sep 23 07:50:58 2020 +++ src/usr.bin/make/unit-tests/counter.mk Wed Sep 23 07:54:08 2020 @@ -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