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 tests/make: demonstrate bug for .SIL...



details:   https://anonhg.NetBSD.org/src/rev/66671f9bdbcd
branches:  trunk
changeset: 361138:66671f9bdbcd
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Feb 12 01:15:17 2022 +0000

description:
tests/make: demonstrate bug for .SILENT in jobs mode (since 2003)

Reported 2011 in PR#45356.

diffstat:

 distrib/sets/lists/tests/mi                    |   4 ++-
 usr.bin/make/unit-tests/Makefile               |   3 +-
 usr.bin/make/unit-tests/deptgt-silent-jobs.exp |   8 +++++
 usr.bin/make/unit-tests/deptgt-silent-jobs.mk  |  36 ++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 2 deletions(-)

diffs (87 lines):

diff -r e384a3cdf01c -r 66671f9bdbcd distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Fri Feb 11 23:49:28 2022 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Feb 12 01:15:17 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1186 2022/02/07 22:43:50 rillig Exp $
+# $NetBSD: mi,v 1.1187 2022/02/12 01:15:17 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5561,6 +5561,8 @@
 ./usr/tests/usr.bin/make/unit-tests/deptgt-precious.mk                         tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-shell.exp                           tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-shell.mk                            tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-silent-jobs.exp                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-silent-jobs.mk                      tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-silent.exp                          tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-silent.mk                           tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-stale.exp                           tests-usr.bin-tests     compattestfile,atf
diff -r e384a3cdf01c -r 66671f9bdbcd usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Fri Feb 11 23:49:28 2022 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sat Feb 12 01:15:17 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.307 2022/02/09 21:24:29 rillig Exp $
+# $NetBSD: Makefile,v 1.308 2022/02/12 01:15:18 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -146,6 +146,7 @@
 TESTS+=                deptgt-precious
 TESTS+=                deptgt-shell
 TESTS+=                deptgt-silent
+TESTS+=                deptgt-silent-jobs
 TESTS+=                deptgt-stale
 TESTS+=                deptgt-suffixes
 TESTS+=                dir
diff -r e384a3cdf01c -r 66671f9bdbcd usr.bin/make/unit-tests/deptgt-silent-jobs.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-silent-jobs.exp    Sat Feb 12 01:15:17 2022 +0000
@@ -0,0 +1,8 @@
+compat: testing 1
+compat: testing 2
+compat: testing 3
+jobs: testing 1
+echo 'jobs: testing 2'
+jobs: testing 2
+jobs: testing 3
+exit status 0
diff -r e384a3cdf01c -r 66671f9bdbcd usr.bin/make/unit-tests/deptgt-silent-jobs.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-silent-jobs.mk     Sat Feb 12 01:15:17 2022 +0000
@@ -0,0 +1,36 @@
+# $NetBSD: deptgt-silent-jobs.mk,v 1.1 2022/02/12 01:15:18 rillig Exp $
+#
+# Ensure that the special dependency target '.SILENT' only affects the amount
+# of output, but not the kind of error handling.
+#
+# History:
+#      In job.c 1.83 from 2003.12.20.00.18.22, in an attempt to fix
+#      https://gnats.netbsd.org/18573, commands that suppressed error
+#      handling were output in jobs mode, even when the global '.SILENT'
+#      was set.
+#
+# See also:
+#      https://gnats.netbsd.org/45356
+
+all: compat jobs
+.PHONY: all compat jobs test
+
+.SILENT:
+test:
+       @echo '${VARIANT}: testing 1'
+       -echo '${VARIANT}: testing 2'
+       echo '${VARIANT}: testing 3'
+
+# expect: compat: testing 1
+# expect: compat: testing 2
+# expect: compat: testing 3
+compat:
+       @${MAKE} -r -f ${MAKEFILE} test VARIANT=compat
+
+# expect: jobs: testing 1
+# FIXME: suppress 'echo 'jobs: testing 2''
+# expect: echo 'jobs: testing 2'
+# expect: jobs: testing 2
+# expect: jobs: testing 3
+jobs:
+       @${MAKE} -r -f ${MAKEFILE} test VARIANT=jobs -j1



Home | Main Index | Thread Index | Old Index