Module Name: src
Committed By: rillig
Date: Wed Dec 9 07:24:52 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: opt-jobs-no-action.exp
opt-jobs-no-action.mk
Log Message:
make(1): refine test for combining -j1 and -n
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/opt-jobs-no-action.exp \
src/usr.bin/make/unit-tests/opt-jobs-no-action.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-jobs-no-action.exp
diff -u src/usr.bin/make/unit-tests/opt-jobs-no-action.exp:1.2 src/usr.bin/make/unit-tests/opt-jobs-no-action.exp:1.3
--- src/usr.bin/make/unit-tests/opt-jobs-no-action.exp:1.2 Wed Dec 9 00:43:48 2020
+++ src/usr.bin/make/unit-tests/opt-jobs-no-action.exp Wed Dec 9 07:24:52 2020
@@ -22,51 +22,55 @@ echo silent=no always=no ignerr=no
silent=no always=no ignerr=no
# .echoOff
# .errOnOrEcho
-echo "true"
+echo "echo running"
# .errExit
-{ true
+{ echo running
} || exit $?
# .echoOn
echo
echo silent=no always=no ignerr=yes
silent=no always=no ignerr=yes
-false
+echo running; false
echo
echo silent=no always=yes ignerr=no
silent=no always=yes ignerr=no
-true
+echo running
+running
echo
echo silent=no always=yes ignerr=yes
silent=no always=yes ignerr=yes
-false
+echo running; false
+running
*** Error code 1 (ignored)
echo
echo silent=yes always=no ignerr=no
silent=yes always=no ignerr=no
# .errExit
-{ true
+{ echo running
} || exit $?
# .echoOn
echo
echo silent=yes always=no ignerr=yes
silent=yes always=no ignerr=yes
-false
+echo running; false
# .echoOn
echo
echo silent=yes always=yes ignerr=no
silent=yes always=yes ignerr=no
-true
+echo running
+running
echo
echo silent=yes always=yes ignerr=yes
silent=yes always=yes ignerr=yes
-false
+echo running; false
+running
*** Error code 1 (ignored)
echo
Index: src/usr.bin/make/unit-tests/opt-jobs-no-action.mk
diff -u src/usr.bin/make/unit-tests/opt-jobs-no-action.mk:1.2 src/usr.bin/make/unit-tests/opt-jobs-no-action.mk:1.3
--- src/usr.bin/make/unit-tests/opt-jobs-no-action.mk:1.2 Wed Dec 9 00:43:48 2020
+++ src/usr.bin/make/unit-tests/opt-jobs-no-action.mk Wed Dec 9 07:24:52 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-jobs-no-action.mk,v 1.2 2020/12/09 00:43:48 rillig Exp $
+# $NetBSD: opt-jobs-no-action.mk,v 1.3 2020/12/09 07:24:52 rillig Exp $
#
# Tests for the combination of the options -j and -n, which prints the
# commands instead of actually running them.
@@ -30,13 +30,6 @@
ignore="\# .errOffOrExecIgnore\n""%s\n" \
errout="\# .errExit\n""{ %s \n} || exit $$?\n"
-SILENT.no= # none
-SILENT.yes= @
-ALWAYS.no= # none
-ALWAYS.yes= +
-IGNERR.no= true
-IGNERR.yes= -false
-
all: documented combined
.ORDER: documented combined
@@ -64,10 +57,20 @@ documented: .PHONY
@+echo
+
# Test all combinations of the 3 RunFlags.
#
# TODO: Closely inspect the output whether it makes sense.
# XXX: The output should not contain the 'echo silent=...' lines.
+# XXX: silent=no always=no ignerr={no,yes} should be almost the same.
+#
+SILENT.no= # none
+SILENT.yes= @
+ALWAYS.no= # none
+ALWAYS.yes= +
+IGNERR.no= echo running
+IGNERR.yes= -echo running; false
+#
combined:
@+echo 'begin $@'
@+echo