Module Name:    src
Committed By:   rillig
Date:           Wed Dec  9 08:18:35 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: Makefile opt-jobs-no-action.exp
            opt-jobs-no-action.mk

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


To generate a diff of this commit:
cvs rdiff -u -r1.242 -r1.243 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-jobs-no-action.exp
cvs rdiff -u -r1.5 -r1.6 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/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.242 src/usr.bin/make/unit-tests/Makefile:1.243
--- src/usr.bin/make/unit-tests/Makefile:1.242	Wed Dec  9 07:57:52 2020
+++ src/usr.bin/make/unit-tests/Makefile	Wed Dec  9 08:18:35 2020
@@ -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,JobFinis
 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
 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

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.3 src/usr.bin/make/unit-tests/opt-jobs-no-action.exp:1.4
--- src/usr.bin/make/unit-tests/opt-jobs-no-action.exp:1.3	Wed Dec  9 07:24:52 2020
+++ src/usr.bin/make/unit-tests/opt-jobs-no-action.exp	Wed Dec  9 08:18:35 2020
@@ -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

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.5 src/usr.bin/make/unit-tests/opt-jobs-no-action.mk:1.6
--- src/usr.bin/make/unit-tests/opt-jobs-no-action.mk:1.5	Wed Dec  9 08:15:45 2020
+++ src/usr.bin/make/unit-tests/opt-jobs-no-action.mk	Wed Dec  9 08:18:35 2020
@@ -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'

Reply via email to