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): fix test job-output-long-lines



details:   https://anonhg.NetBSD.org/src/rev/b881c2f19ecd
branches:  trunk
changeset: 939995:b881c2f19ecd
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Sep 29 18:16:24 2020 +0000

description:
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.

diffstat:

 usr.bin/make/unit-tests/Makefile                  |  15 ++++++++++++---
 usr.bin/make/unit-tests/job-output-long-lines.exp |   1 -
 usr.bin/make/unit-tests/job-output-long-lines.mk  |   6 +-----
 3 files changed, 13 insertions(+), 9 deletions(-)

diffs (62 lines):

diff -r fd106fb5fd9e -r b881c2f19ecd usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Tue Sep 29 18:13:29 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Tue Sep 29 18:16:24 2020 +0000
@@ -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-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 @@
 # 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'
diff -r fd106fb5fd9e -r b881c2f19ecd usr.bin/make/unit-tests/job-output-long-lines.exp
--- a/usr.bin/make/unit-tests/job-output-long-lines.exp Tue Sep 29 18:13:29 2020 +0000
+++ b/usr.bin/make/unit-tests/job-output-long-lines.exp Tue Sep 29 18:16:24 2020 +0000
@@ -1,2 +1,1 @@
-bad
 exit status 0
diff -r fd106fb5fd9e -r b881c2f19ecd usr.bin/make/unit-tests/job-output-long-lines.mk
--- a/usr.bin/make/unit-tests/job-output-long-lines.mk  Tue Sep 29 18:13:29 2020 +0000
+++ b/usr.bin/make/unit-tests/job-output-long-lines.mk  Tue Sep 29 18:16:24 2020 +0000
@@ -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
 



Home | Main Index | Thread Index | Old Index