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): add test for merging long l...
details: https://anonhg.NetBSD.org/src/rev/5ea0b43d222e
branches: trunk
changeset: 955383:5ea0b43d222e
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Sep 27 20:11:33 2020 +0000
description:
make(1): add test for merging long lines of job output
diffstat:
distrib/sets/lists/tests/mi | 4 +-
usr.bin/make/unit-tests/Makefile | 5 ++-
usr.bin/make/unit-tests/job-output-long-lines.exp | 2 +
usr.bin/make/unit-tests/job-output-long-lines.mk | 36 +++++++++++++++++++++++
4 files changed, 45 insertions(+), 2 deletions(-)
diffs (90 lines):
diff -r 4c6bac9a17d6 -r 5ea0b43d222e distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sun Sep 27 19:55:21 2020 +0000
+++ b/distrib/sets/lists/tests/mi Sun Sep 27 20:11:33 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.930 2020/09/25 23:24:49 rillig Exp $
+# $NetBSD: mi,v 1.931 2020/09/27 20:11:33 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4812,6 +4812,8 @@
./usr/tests/usr.bin/make/unit-tests/include-main.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/include-sub.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/include-subsub.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/lint.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/lint.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/make-exported.exp tests-usr.bin-tests compattestfile,atf
diff -r 4c6bac9a17d6 -r 5ea0b43d222e usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Sun Sep 27 19:55:21 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Sun Sep 27 20:11:33 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.153 2020/09/27 13:18:30 rillig Exp $
+# $NetBSD: Makefile,v 1.154 2020/09/27 20:11:34 rillig Exp $
#
# Unit tests for make(1)
#
@@ -169,6 +169,7 @@
TESTS+= forsubst
TESTS+= impsrc
TESTS+= include-main
+TESTS+= job-output-long-lines
TESTS+= lint
TESTS+= make-exported
TESTS+= misc
@@ -403,6 +404,8 @@
# 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 4c6bac9a17d6 -r 5ea0b43d222e usr.bin/make/unit-tests/job-output-long-lines.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/job-output-long-lines.exp Sun Sep 27 20:11:33 2020 +0000
@@ -0,0 +1,2 @@
+bad
+exit status 0
diff -r 4c6bac9a17d6 -r 5ea0b43d222e usr.bin/make/unit-tests/job-output-long-lines.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/job-output-long-lines.mk Sun Sep 27 20:11:33 2020 +0000
@@ -0,0 +1,36 @@
+# $NetBSD: job-output-long-lines.mk,v 1.1 2020/09/27 20:11:34 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.
+#
+# Each of these lines must be written atomically to the actual output.
+# The markers for switching jobs must always be written at the beginning of
+# the line, to make them clearly visible in large log files.
+#
+# As of 2020-09-27, the default job buffer size is 1024. When a job produces
+# output lines that are longer than this buffer size, these output pieces are
+# not terminated by a newline. Because of this missing newline, the job
+# 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
+
+100:= ${:U1:S,1,2222222222,g:S,2,3333333333,g}
+10000:= ${100:S,3,4444444444,g:S,4,xxxxxxxxxx,g}
+
+all: job-a job-b
+
+job-a:
+.for i in ${:U:range=100}
+ @echo ${10000:S,x,a,g}
+.endfor
+
+job-b:
+.for i in ${:U:range=100}
+ @echo ${10000:S,x,b,g}
+.endfor
Home |
Main Index |
Thread Index |
Old Index