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 tests/make: make output of test job-...



details:   https://anonhg.NetBSD.org/src/rev/8c4abf8d1fec
branches:  trunk
changeset: 1023530:8c4abf8d1fec
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 12 10:26:49 2021 +0000

description:
tests/make: make output of test job-output-null clearer

Having 5 times the word 'hello' in the output doesn't help at
understanding the test and how the output was produced.

Bash 5 sometimes makes this test fail by adding '2b' and '2c' to the
output.

diffstat:

 usr.bin/make/unit-tests/job-output-null.exp |  6 +++---
 usr.bin/make/unit-tests/job-output-null.mk  |  8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (43 lines):

diff -r 7ff925993486 -r 8c4abf8d1fec usr.bin/make/unit-tests/job-output-null.exp
--- a/usr.bin/make/unit-tests/job-output-null.exp       Sun Sep 12 10:06:03 2021 +0000
+++ b/usr.bin/make/unit-tests/job-output-null.exp       Sun Sep 12 10:26:49 2021 +0000
@@ -1,4 +1,4 @@
-hello
-hello
-hello without   newline, hello without   newline.
+1
+2a
+3a without   newline, 3b without   newline.
 exit status 0
diff -r 7ff925993486 -r 8c4abf8d1fec usr.bin/make/unit-tests/job-output-null.mk
--- a/usr.bin/make/unit-tests/job-output-null.mk        Sun Sep 12 10:06:03 2021 +0000
+++ b/usr.bin/make/unit-tests/job-output-null.mk        Sun Sep 12 10:26:49 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: job-output-null.mk,v 1.2 2021/07/03 22:39:40 rillig Exp $
+# $NetBSD: job-output-null.mk,v 1.3 2021/09/12 10:26:49 rillig Exp $
 #
 # Test how null bytes in the output of a command are handled.  Make processes
 # them using null-terminated strings, which may cut off some of the output.
@@ -26,14 +26,14 @@
        # The null byte from the command output is kept as-is.
        # See CollectOutput, which looks like it intended to replace these
        # null bytes with simple spaces.
-       @printf 'hello\0world\n'
+       @printf '1\0trailing\n'
 
        # Give the parent process a chance to see the above output, but not
        # yet the output from the next printf command.
        @sleep 1
 
        # All null bytes from the command output are kept as-is.
-       @printf 'hello\0world\n''hello\0world\n''hello\0world\n'
+       @printf '2a\0trailing\n''2b\0trailing\n''2c\0trailing\n'
 
        @sleep 1
 
@@ -42,4 +42,4 @@
        #
        # The three null bytes in a row test whether this output is
        # compressed to a single space like in DebugFailedTarget.  It isn't.
-       @printf 'hello\0without\0\0\0newline, hello\0without\0\0\0newline.'
+       @printf '3a\0without\0\0\0newline, 3b\0without\0\0\0newline.'



Home | Main Index | Thread Index | Old Index