Module Name:    src
Committed By:   rillig
Date:           Sun Oct 18 18:12:42 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: opt-ignore.exp opt-ignore.mk
            opt-keep-going.exp opt-keep-going.mk sh-dots.exp sh-dots.mk

Log Message:
make(1): switch some tests to line-buffered stdout

On Alpine Linux, the output was not in the same order as on NetBSD,
at least since bmake-20200902.

The mixture of block-buffered output from child processes and make
itself was hard to predict anyway.  Switching to line-buffered stdout
improves the stability of the tests.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-ignore.exp \
    src/usr.bin/make/unit-tests/opt-keep-going.exp \
    src/usr.bin/make/unit-tests/sh-dots.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-ignore.mk \
    src/usr.bin/make/unit-tests/opt-keep-going.mk
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/sh-dots.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/opt-ignore.exp
diff -u src/usr.bin/make/unit-tests/opt-ignore.exp:1.2 src/usr.bin/make/unit-tests/opt-ignore.exp:1.3
--- src/usr.bin/make/unit-tests/opt-ignore.exp:1.2	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-ignore.exp	Sun Oct 18 18:12:42 2020
@@ -1,12 +1,12 @@
 dependency 1
+*** Error code 1 (ignored)
 dependency 2
+*** Error code 7 (ignored)
 dependency 3
 other 1
+*** Error code 1 (ignored)
 other 2
 main 1
-main 2
-*** Error code 1 (ignored)
-*** Error code 7 (ignored)
-*** Error code 1 (ignored)
 *** Error code 1 (ignored)
+main 2
 exit status 0
Index: src/usr.bin/make/unit-tests/opt-keep-going.exp
diff -u src/usr.bin/make/unit-tests/opt-keep-going.exp:1.2 src/usr.bin/make/unit-tests/opt-keep-going.exp:1.3
--- src/usr.bin/make/unit-tests/opt-keep-going.exp:1.2	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-keep-going.exp	Sun Oct 18 18:12:42 2020
@@ -1,6 +1,6 @@
 dependency 1
-other 1
 *** Error code 1 (continuing)
+other 1
 *** Error code 1 (continuing)
 `all' not remade because of errors.
 exit status 0
Index: src/usr.bin/make/unit-tests/sh-dots.exp
diff -u src/usr.bin/make/unit-tests/sh-dots.exp:1.2 src/usr.bin/make/unit-tests/sh-dots.exp:1.3
--- src/usr.bin/make/unit-tests/sh-dots.exp:1.2	Sat Aug 29 19:35:38 2020
+++ src/usr.bin/make/unit-tests/sh-dots.exp	Sun Oct 18 18:12:42 2020
@@ -1,15 +1,15 @@
 first first
 hidden hidden
 make: exec(...) failed (No such file or directory)
+*** Error code 1 (ignored)
 hidden delayed hidden
 repeated repeated
 commented commented
-*** Error code 1 (ignored)
 ...	# Run the below commands later
 <normalized: ...: not found>
+*** Error code 127 (ignored)
 commented delayed commented
 first delayed first
 repeated delayed repeated
 repeated delayed twice repeated
-*** Error code 127 (ignored)
 exit status 0

Index: src/usr.bin/make/unit-tests/opt-ignore.mk
diff -u src/usr.bin/make/unit-tests/opt-ignore.mk:1.3 src/usr.bin/make/unit-tests/opt-ignore.mk:1.4
--- src/usr.bin/make/unit-tests/opt-ignore.mk:1.3	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-ignore.mk	Sun Oct 18 18:12:42 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-ignore.mk,v 1.3 2020/08/23 14:28:04 rillig Exp $
+# $NetBSD: opt-ignore.mk,v 1.4 2020/10/18 18:12:42 rillig Exp $
 #
 # Tests for the -i command line option, which ignores the exit status of the
 # shell commands, and just continues with the next command, even from the same
@@ -10,6 +10,8 @@
 # file, where they cannot be related to the individual shell commands that
 # failed?
 
+.MAKEFLAGS: -d0			# switch stdout to being line-buffered
+
 all: dependency other
 
 dependency:
Index: src/usr.bin/make/unit-tests/opt-keep-going.mk
diff -u src/usr.bin/make/unit-tests/opt-keep-going.mk:1.3 src/usr.bin/make/unit-tests/opt-keep-going.mk:1.4
--- src/usr.bin/make/unit-tests/opt-keep-going.mk:1.3	Sun Aug 23 14:28:04 2020
+++ src/usr.bin/make/unit-tests/opt-keep-going.mk	Sun Oct 18 18:12:42 2020
@@ -1,9 +1,11 @@
-# $NetBSD: opt-keep-going.mk,v 1.3 2020/08/23 14:28:04 rillig Exp $
+# $NetBSD: opt-keep-going.mk,v 1.4 2020/10/18 18:12:42 rillig Exp $
 #
 # Tests for the -k command line option, which stops building a target as soon
 # as an error is detected, but continues building the other, independent
 # targets, as far as possible.
 
+.MAKEFLAGS: -d0			# switch stdout to being line-buffered
+
 all: dependency other
 
 dependency:

Index: src/usr.bin/make/unit-tests/sh-dots.mk
diff -u src/usr.bin/make/unit-tests/sh-dots.mk:1.1 src/usr.bin/make/unit-tests/sh-dots.mk:1.2
--- src/usr.bin/make/unit-tests/sh-dots.mk:1.1	Sat Aug 22 11:27:02 2020
+++ src/usr.bin/make/unit-tests/sh-dots.mk	Sun Oct 18 18:12:42 2020
@@ -1,9 +1,11 @@
-# $NetBSD: sh-dots.mk,v 1.1 2020/08/22 11:27:02 rillig Exp $
+# $NetBSD: sh-dots.mk,v 1.2 2020/10/18 18:12:42 rillig Exp $
 #
 # Tests for the special shell command line "...", which does not run the
 # commands below it but appends them to the list of commands that are run
 # at the end.
 
+.MAKEFLAGS: -d0			# switch stdout to being line-buffered
+
 all: first hidden repeated commented
 
 # The ${.TARGET} correctly expands to the target name, even though the

Reply via email to