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 make(1): remove noise from test outp...



details:   https://anonhg.NetBSD.org/src/rev/e1dcbd98aadb
branches:  trunk
changeset: 957739:e1dcbd98aadb
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 09 08:18:35 2020 +0000

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

diffstat:

 usr.bin/make/unit-tests/Makefile               |  15 ++++++++++-----
 usr.bin/make/unit-tests/opt-jobs-no-action.exp |  19 -------------------
 usr.bin/make/unit-tests/opt-jobs-no-action.mk  |  12 ++++++------
 3 files changed, 16 insertions(+), 30 deletions(-)

diffs (143 lines):

diff -r 7c8a9c54d12b -r e1dcbd98aadb usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Wed Dec 09 08:15:45 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Wed Dec 09 08:18:35 2020 +0000
@@ -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,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,^\(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
diff -r 7c8a9c54d12b -r e1dcbd98aadb usr.bin/make/unit-tests/opt-jobs-no-action.exp
--- a/usr.bin/make/unit-tests/opt-jobs-no-action.exp    Wed Dec 09 08:15:45 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-jobs-no-action.exp    Wed Dec 09 08:18:35 2020 +0000
@@ -14,11 +14,8 @@
 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 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
diff -r 7c8a9c54d12b -r e1dcbd98aadb usr.bin/make/unit-tests/opt-jobs-no-action.mk
--- a/usr.bin/make/unit-tests/opt-jobs-no-action.mk     Wed Dec 09 08:15:45 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-jobs-no-action.mk     Wed Dec 09 08:18:35 2020 +0000
@@ -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 @@
 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 @@
 .      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 @@
 
 combined: combined-end
 combined-end: .PHONY
-       @+echo 'end combined'
+       @+echo hide-from-output 'end combined'



Home | Main Index | Thread Index | Old Index