make(1): remove noise from test output of opt-jobs-no-action

This commit is contained in:
rillig 2020-12-09 08:18:35 +00:00
parent a98a651d79
commit 255e230425
3 changed files with 16 additions and 30 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.242 2020/12/09 07:57:52 rillig Exp $
# $NetBSD: Makefile,v 1.243 2020/12/09 08:18:35 rillig Exp $
#
# Unit tests for make(1)
#
@ -476,10 +476,8 @@ SED_CMDS.opt-debug-jobs+= -e 's,JobFinish: [0-9][0-9]*,JobFinish: <pid>,'
SED_CMDS.opt-debug-jobs+= -e 's,Command: ${.SHELL:T},Command: <shell>,'
# The "-q" may be there or not, see jobs.c, variable shells.
SED_CMDS.opt-debug-jobs+= -e 's,^\(.Command: <shell>\) -q,\1,'
SED_CMDS.opt-no-action-runflags= \
-e '/^echo hide-from-output/d' \
-e 's,hide-from-output ,,' \
-e 's,hide-from-output,,'
SED_CMDS.opt-jobs-no-action= ${STD_SED_CMDS.hide-from-output}
SED_CMDS.opt-no-action-runflags= ${STD_SED_CMDS.hide-from-output}
# For Compat_RunCommand, useShell == FALSE.
SED_CMDS.sh-dots= -e 's,^.*\.\.\.:.*,<not found: ...>,'
# For Compat_RunCommand, useShell == TRUE.
@ -529,6 +527,13 @@ STD_SED_CMDS.dg1+= -e 's,^\(\.MAKE\.[A-Z_]* *=\) .*,\1 <details omitted>,'
STD_SED_CMDS.dg1+= -e 's,^\(MACHINE[_ARCH]* *=\) .*,\1 <details omitted>,'
STD_SED_CMDS.dg1+= -e 's,^\(MAKE *=\) .*,\1 <details omitted>,'
# Reduce the noise for tests running with the -n option, since there is no
# other way to suppress the echoing of the commands.
STD_SED_CMDS.hide-from-output= \
-e '/^echo hide-from-output/d' \
-e 's,hide-from-output ,,' \
-e 's,hide-from-output,,'
# End of the configuration helpers section.
.MAIN: all

View File

@ -14,11 +14,8 @@ echo run despite the -n option
run despite the -n option
echo
echo 'begin combined'
begin combined
echo
echo silent=no always=no ignerr=no
silent=no always=no ignerr=no
# .echoOff
# .errOnOrEcho
@ -27,53 +24,37 @@ echo "echo running"
{ echo running
} || exit $?
# .echoOn
echo
echo silent=no always=no ignerr=yes
silent=no always=no ignerr=yes
echo running; false
echo
echo silent=no always=yes ignerr=no
silent=no always=yes ignerr=no
echo running
running
echo
echo silent=no always=yes ignerr=yes
silent=no always=yes ignerr=yes
echo running; false
running
*** Error code 1 (ignored)
echo
echo silent=yes always=no ignerr=no
silent=yes always=no ignerr=no
# .errExit
{ echo running
} || exit $?
# .echoOn
echo
echo silent=yes always=no ignerr=yes
silent=yes always=no ignerr=yes
echo running; false
# .echoOn
echo
echo silent=yes always=yes ignerr=no
silent=yes always=yes ignerr=no
echo running
running
echo
echo silent=yes always=yes ignerr=yes
silent=yes always=yes ignerr=yes
echo running; false
running
*** Error code 1 (ignored)
echo
echo 'end combined'
end combined
exit status 0

View File

@ -1,4 +1,4 @@
# $NetBSD: opt-jobs-no-action.mk,v 1.5 2020/12/09 08:15:45 rillig Exp $
# $NetBSD: opt-jobs-no-action.mk,v 1.6 2020/12/09 08:18:35 rillig Exp $
#
# Tests for the combination of the options -j and -n, which prints the
# commands instead of actually running them.
@ -77,8 +77,8 @@ IGNERR.yes= -echo running; false
combined: combined-begin
combined-begin: .PHONY
@+echo 'begin combined'
@+echo
@+echo hide-from-output 'begin combined'
@+echo hide-from-output
.for silent in no yes
. for always in no yes
@ -86,9 +86,9 @@ combined-begin: .PHONY
. for target in combined-silent-${silent}-always-${always}-ignerr-${ignerr}
combined: .WAIT ${target} .WAIT
${target}: .PHONY
@+echo silent=${silent} always=${always} ignerr=${ignerr}
@+echo hide-from-output silent=${silent} always=${always} ignerr=${ignerr}
${SILENT.${silent}}${ALWAYS.${always}}${IGNERR.${ignerr}}
@+echo
@+echo hide-from-output
. endfor
. endfor
. endfor
@ -96,4 +96,4 @@ ${target}: .PHONY
combined: combined-end
combined-end: .PHONY
@+echo 'end combined'
@+echo hide-from-output 'end combined'