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): add test for .END after fai...



details:   https://anonhg.NetBSD.org/src/rev/525da5f28514
branches:  trunk
changeset: 946727:525da5f28514
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Dec 06 21:22:04 2020 +0000

description:
make(1): add test for .END after failed main node

diffstat:

 distrib/sets/lists/tests/mi                         |   4 +++-
 usr.bin/make/unit-tests/Makefile                    |   3 ++-
 usr.bin/make/unit-tests/deptgt-end-fail-all.exp     |  10 ++++++++++
 usr.bin/make/unit-tests/deptgt-end-fail-all.mk      |  13 +++++++++++++
 usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk |   3 ++-
 usr.bin/make/unit-tests/deptgt-end-fail.exp         |   1 +
 usr.bin/make/unit-tests/deptgt-end-fail.mk          |   3 ++-
 7 files changed, 33 insertions(+), 4 deletions(-)

diffs (107 lines):

diff -r 4af517ec13e1 -r 525da5f28514 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sun Dec 06 20:55:30 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Sun Dec 06 21:22:04 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.982 2020/12/01 22:16:36 rillig Exp $
+# $NetBSD: mi,v 1.983 2020/12/06 21:22:04 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4965,6 +4965,8 @@
 ./usr/tests/usr.bin/make/unit-tests/deptgt-default.mk                          tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-delete_on_error.exp                 tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-delete_on_error.mk                  tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-all.exp                    tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-all.mk                     tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-indirect.exp               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk                        tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-end-fail.exp                                tests-usr.bin-tests     compattestfile,atf
diff -r 4af517ec13e1 -r 525da5f28514 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Sun Dec 06 20:55:30 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Sun Dec 06 21:22:04 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.236 2020/12/05 03:42:15 sjg Exp $
+# $NetBSD: Makefile,v 1.237 2020/12/06 21:22:04 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -115,6 +115,7 @@
 TESTS+=                deptgt-delete_on_error
 TESTS+=                deptgt-end
 TESTS+=                deptgt-end-fail
+TESTS+=                deptgt-end-fail-all
 TESTS+=                deptgt-end-fail-indirect
 TESTS+=                deptgt-end-jobs
 TESTS+=                deptgt-error
diff -r 4af517ec13e1 -r 525da5f28514 usr.bin/make/unit-tests/deptgt-end-fail-all.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-end-fail-all.exp   Sun Dec 06 21:22:04 2020 +0000
@@ -0,0 +1,10 @@
+: Making all out of nothing.
+false
+*** Error code 1 (continuing)
+: Making .END out of nothing.
+false
+*** Error code 1 (continuing)
+
+Stop.
+make: stopped in unit-tests
+exit status 1
diff -r 4af517ec13e1 -r 525da5f28514 usr.bin/make/unit-tests/deptgt-end-fail-all.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-end-fail-all.mk    Sun Dec 06 21:22:04 2020 +0000
@@ -0,0 +1,13 @@
+# $NetBSD: deptgt-end-fail-all.mk,v 1.1 2020/12/06 21:22:04 rillig Exp $
+#
+# Test whether the commands from the .END target are run even if there is
+# an error before.  The manual page says "after everything else is done",
+# which leaves room for interpretation.
+
+all: .PHONY
+       : Making ${.TARGET} out of nothing.
+       false
+
+.END:
+       : Making ${.TARGET} out of nothing.
+       false
diff -r 4af517ec13e1 -r 525da5f28514 usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk
--- a/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk       Sun Dec 06 20:55:30 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-end-fail-indirect.mk       Sun Dec 06 21:22:04 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-end-fail-indirect.mk,v 1.1 2020/11/24 17:59:42 rillig Exp $
+# $NetBSD: deptgt-end-fail-indirect.mk,v 1.2 2020/12/06 21:22:04 rillig Exp $
 #
 # Tests for an error in a dependency of the .END node.
 #
@@ -10,6 +10,7 @@
        : $@
 
 .END: failing
+       : Making ${.TARGET} from ${.ALLSRC}.
 
 failing: .PHONY
        false
diff -r 4af517ec13e1 -r 525da5f28514 usr.bin/make/unit-tests/deptgt-end-fail.exp
--- a/usr.bin/make/unit-tests/deptgt-end-fail.exp       Sun Dec 06 20:55:30 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-end-fail.exp       Sun Dec 06 21:22:04 2020 +0000
@@ -1,4 +1,5 @@
 : all
+: Making .END out of nothing.
 false
 *** Error code 1 (continuing)
 
diff -r 4af517ec13e1 -r 525da5f28514 usr.bin/make/unit-tests/deptgt-end-fail.mk
--- a/usr.bin/make/unit-tests/deptgt-end-fail.mk        Sun Dec 06 20:55:30 2020 +0000
+++ b/usr.bin/make/unit-tests/deptgt-end-fail.mk        Sun Dec 06 21:22:04 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt-end-fail.mk,v 1.2 2020/11/24 17:59:42 rillig Exp $
+# $NetBSD: deptgt-end-fail.mk,v 1.3 2020/12/06 21:22:04 rillig Exp $
 #
 # Tests for an error in the .END node.
 #
@@ -10,4 +10,5 @@
        : $@
 
 .END:
+       : Making ${.TARGET} out of nothing.
        false



Home | Main Index | Thread Index | Old Index