From 332d2f1b45e09c650019d6f1f50d734a5ef8e899 Mon Sep 17 00:00:00 2001 From: rillig Date: Wed, 9 Dec 2020 07:24:52 +0000 Subject: [PATCH] make(1): refine test for combining -j1 and -n --- .../make/unit-tests/opt-jobs-no-action.exp | 22 +++++++++++-------- usr.bin/make/unit-tests/opt-jobs-no-action.mk | 19 +++++++++------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/usr.bin/make/unit-tests/opt-jobs-no-action.exp b/usr.bin/make/unit-tests/opt-jobs-no-action.exp index e3b285b15e60..a76fd6d6998e 100644 --- a/usr.bin/make/unit-tests/opt-jobs-no-action.exp +++ b/usr.bin/make/unit-tests/opt-jobs-no-action.exp @@ -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 diff --git a/usr.bin/make/unit-tests/opt-jobs-no-action.mk b/usr.bin/make/unit-tests/opt-jobs-no-action.mk index 8bd18e96cb8b..25e5d0b27f7f 100644 --- a/usr.bin/make/unit-tests/opt-jobs-no-action.mk +++ b/usr.bin/make/unit-tests/opt-jobs-no-action.mk @@ -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