Module Name: src
Committed By: rillig
Date: Tue Sep 29 18:16:24 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: Makefile job-output-long-lines.exp
job-output-long-lines.mk
Log Message:
make(1): fix test job-output-long-lines
The test failed on Linux since the test relied on the two child
processes interleaving each other. This is not guaranteed to happen
though.
To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/usr.bin/make/unit-tests/job-output-long-lines.exp \
src/usr.bin/make/unit-tests/job-output-long-lines.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.154 src/usr.bin/make/unit-tests/Makefile:1.155
--- src/usr.bin/make/unit-tests/Makefile:1.154 Sun Sep 27 20:11:34 2020
+++ src/usr.bin/make/unit-tests/Makefile Tue Sep 29 18:16:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.154 2020/09/27 20:11:34 rillig Exp $
+# $NetBSD: Makefile,v 1.155 2020/09/29 18:16:24 rillig Exp $
#
# Unit tests for make(1)
#
@@ -385,6 +385,17 @@ FLAGS.varname-dot-shell= -dpv
FLAGS.varname-empty= -dv '$${:U}=cmdline-u' '=cmline-plain'
# Some tests need extra postprocessing.
+SED_CMDS.job-output-long-lines= \
+ ${:D Job separators on their own line are ok. } \
+ -e '/^--- job-[ab] ---$$/d' \
+ ${:D Plain output lines are ok as well. } \
+ ${:D They may come in multiples of 1024 or as 10000. } \
+ -e '/^aa*$$/d' \
+ -e '/^bb*$$/d' \
+ ${:D The following lines should rather not occur since the job } \
+ ${:D marker should always be at the beginning of the line. } \
+ -e '/^aa*--- job-b ---$$/d' \
+ -e '/^bb*--- job-a ---$$/d'
SED_CMDS.opt-debug-graph1= \
-e 's,${.CURDIR},CURDIR,'
SED_CMDS.opt-debug-graph1+= \
@@ -404,8 +415,6 @@ SED_CMDS.varname-dot-shell+= -e 's,\[/[^
# Some tests need an additional round of postprocessing.
POSTPROC.deptgt-suffixes= \
${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
-POSTPROC.job-output-long-lines= \
- awk '/^[ab]+--- job-[ab] ---/ { print "bad"; exit }'
POSTPROC.vardebug= ${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p'
POSTPROC.varmod-match-escape= ${TOOL_SED} -n -e '/^Pattern/p'
POSTPROC.varname= ${TOOL_SED} -n -e '/^MAGIC/p' -e '/^ORDER_/p'
Index: src/usr.bin/make/unit-tests/job-output-long-lines.exp
diff -u src/usr.bin/make/unit-tests/job-output-long-lines.exp:1.1 src/usr.bin/make/unit-tests/job-output-long-lines.exp:1.2
--- src/usr.bin/make/unit-tests/job-output-long-lines.exp:1.1 Sun Sep 27 20:11:34 2020
+++ src/usr.bin/make/unit-tests/job-output-long-lines.exp Tue Sep 29 18:16:24 2020
@@ -1,2 +1 @@
-bad
exit status 0
Index: src/usr.bin/make/unit-tests/job-output-long-lines.mk
diff -u src/usr.bin/make/unit-tests/job-output-long-lines.mk:1.1 src/usr.bin/make/unit-tests/job-output-long-lines.mk:1.2
--- src/usr.bin/make/unit-tests/job-output-long-lines.mk:1.1 Sun Sep 27 20:11:34 2020
+++ src/usr.bin/make/unit-tests/job-output-long-lines.mk Tue Sep 29 18:16:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: job-output-long-lines.mk,v 1.1 2020/09/27 20:11:34 rillig Exp $
+# $NetBSD: job-output-long-lines.mk,v 1.2 2020/09/29 18:16:24 rillig Exp $
#
# The jobs may produce long lines of output. A practical case are the echoed
# command lines from compiler invocations, with their many -D options.
@@ -13,10 +13,6 @@
# markers "--- job-a ---" and "--- job-b ---" are not always written at the
# beginning of a line, even though this is expected by anyone reading the log
# files.
-#
-# See Makefile, POSTPROC.job-output-long-lines for the output postprocessing.
-#
-# Tags: probabilistic
.MAKEFLAGS: -j2