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 wrong error ...



details:   https://anonhg.NetBSD.org/src/rev/1dd0b75c6d38
branches:  trunk
changeset: 379730:1dd0b75c6d38
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Jun 16 09:39:48 2021 +0000

description:
tests/make: demonstrate wrong error handling in jobs mode

diffstat:

 distrib/sets/lists/tests/mi                           |   4 +++-
 usr.bin/make/unit-tests/Makefile                      |   3 ++-
 usr.bin/make/unit-tests/jobs-empty-commands-error.exp |   4 ++++
 usr.bin/make/unit-tests/jobs-empty-commands-error.mk  |  19 +++++++++++++++++++
 4 files changed, 28 insertions(+), 2 deletions(-)

diffs (66 lines):

diff -r c522fb0d16f9 -r 1dd0b75c6d38 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Wed Jun 16 05:21:08 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Wed Jun 16 09:39:48 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1056 2021/06/06 04:59:36 blymn Exp $
+# $NetBSD: mi,v 1.1057 2021/06/16 09:39:48 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5496,6 +5496,8 @@
 ./usr/tests/usr.bin/make/unit-tests/job-output-long-lines.mk                   tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/job-output-null.exp                                tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/job-output-null.mk                         tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands-error.exp              tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands-error.mk               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands.exp                    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/jobs-empty-commands.mk                     tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/jobs-error-indirect.exp                    tests-usr.bin-tests     compattestfile,atf
diff -r c522fb0d16f9 -r 1dd0b75c6d38 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Wed Jun 16 05:21:08 2021 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Wed Jun 16 09:39:48 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.278 2021/05/18 17:05:45 sjg Exp $
+# $NetBSD: Makefile,v 1.279 2021/06/16 09:39:48 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -206,6 +206,7 @@ TESTS+=             job-flags
 TESTS+=                job-output-long-lines
 TESTS+=                job-output-null
 TESTS+=                jobs-empty-commands
+TESTS+=                jobs-empty-commands-error
 TESTS+=                jobs-error-indirect
 TESTS+=                jobs-error-nested
 TESTS+=                jobs-error-nested-make
diff -r c522fb0d16f9 -r 1dd0b75c6d38 usr.bin/make/unit-tests/jobs-empty-commands-error.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/jobs-empty-commands-error.exp     Wed Jun 16 09:39:48 2021 +0000
@@ -0,0 +1,4 @@
+: 'Making existing-target out of nothing.'
+make: don't know how to make nonexistent-target (continuing)
+`nonexistent-target' was not built (being made, type OP_DEPS_FOUND|OP_MARK, flags REMAKE|DONE_WAIT|DONE_ALLSRC|DONECYCLE)!
+exit status 1
diff -r c522fb0d16f9 -r 1dd0b75c6d38 usr.bin/make/unit-tests/jobs-empty-commands-error.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/jobs-empty-commands-error.mk      Wed Jun 16 09:39:48 2021 +0000
@@ -0,0 +1,19 @@
+# $NetBSD: jobs-empty-commands-error.mk,v 1.1 2021/06/16 09:39:48 rillig Exp $
+#
+# In jobs mode, the shell commands for creating a target are written to a
+# temporary file first, which is then run by the shell.  In chains of
+# dependencies, these files would end up empty.  Since job.c 1.399 from
+# 2021-01-29, these empty files are no longer created.
+#
+# After 2021-01-29, before job.c 1.435 2021-06-16, targets that could not be
+# made led to longer error messages than necessary.
+
+.MAKEFLAGS: -j1
+
+all: existing-target
+
+existing-target:
+       : 'Making $@ out of nothing.'
+
+all: nonexistent-target
+       : 'Not reached'



Home | Main Index | Thread Index | Old Index