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 bug in error h...



details:   https://anonhg.NetBSD.org/src/rev/edb5483a16d0
branches:  trunk
changeset: 1016583:edb5483a16d0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Nov 24 19:02:59 2020 +0000

description:
make(1): add test for bug in error handling of .BEGIN in -k mode

diffstat:

 distrib/sets/lists/tests/mi                            |   6 +++++-
 usr.bin/make/unit-tests/Makefile                       |   4 +++-
 usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp |   4 ++++
 usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk  |  16 ++++++++++++++++
 usr.bin/make/unit-tests/deptgt-begin-fail.exp          |   6 ++++++
 usr.bin/make/unit-tests/deptgt-begin-fail.mk           |  10 ++++++++++
 6 files changed, 44 insertions(+), 2 deletions(-)

diffs (90 lines):

diff -r 385ebf8c42c9 -r edb5483a16d0 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Tue Nov 24 18:17:45 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Tue Nov 24 19:02:59 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.977 2020/11/24 17:59:42 rillig Exp $
+# $NetBSD: mi,v 1.978 2020/11/24 19:02:59 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4955,6 +4955,10 @@
 ./usr/tests/usr.bin/make/unit-tests/depsrc-wait.mk                             tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/depsrc.exp                                 tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/depsrc.mk                                  tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp             tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk              tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail.exp                      tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/deptgt-begin-fail.mk                       tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-begin.exp                           tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-begin.mk                            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/deptgt-default.exp                         tests-usr.bin-tests     compattestfile,atf
diff -r 385ebf8c42c9 -r edb5483a16d0 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Tue Nov 24 18:17:45 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Tue Nov 24 19:02:59 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.223 2020/11/24 17:59:42 rillig Exp $
+# $NetBSD: Makefile,v 1.224 2020/11/24 19:02:59 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -109,6 +109,8 @@
 TESTS+=                depsrc-wait
 TESTS+=                deptgt
 TESTS+=                deptgt-begin
+TESTS+=                deptgt-begin-fail
+TESTS+=                deptgt-begin-fail-indirect
 TESTS+=                deptgt-default
 TESTS+=                deptgt-delete_on_error
 TESTS+=                deptgt-end
diff -r 385ebf8c42c9 -r edb5483a16d0 usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp    Tue Nov 24 19:02:59 2020 +0000
@@ -0,0 +1,4 @@
+false
+*** Error code 1 (continuing)
+: This is not made.
+exit status 0
diff -r 385ebf8c42c9 -r edb5483a16d0 usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk     Tue Nov 24 19:02:59 2020 +0000
@@ -0,0 +1,16 @@
+# $NetBSD: deptgt-begin-fail-indirect.mk,v 1.1 2020/11/24 19:02:59 rillig Exp $
+#
+# Test for a .BEGIN target whose dependency results in an error.
+# This stops make immediately and does not build the main targets.
+#
+# Between 2005-05-08 and 2020-11-24, a failing dependency of the .BEGIN node
+# would not stop make from running the main targets.  In the end, the exit
+# status was even 0.
+
+.BEGIN: failing
+
+failing: .PHONY .NOTMAIN
+       false
+
+all:
+       : This is not made.
diff -r 385ebf8c42c9 -r edb5483a16d0 usr.bin/make/unit-tests/deptgt-begin-fail.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-begin-fail.exp     Tue Nov 24 19:02:59 2020 +0000
@@ -0,0 +1,6 @@
+false
+*** Error code 1 (continuing)
+
+Stop.
+make: stopped in unit-tests
+exit status 1
diff -r 385ebf8c42c9 -r edb5483a16d0 usr.bin/make/unit-tests/deptgt-begin-fail.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/deptgt-begin-fail.mk      Tue Nov 24 19:02:59 2020 +0000
@@ -0,0 +1,10 @@
+# $NetBSD: deptgt-begin-fail.mk,v 1.1 2020/11/24 19:02:59 rillig Exp $
+#
+# Test for a .BEGIN target whose command results in an error.
+# This stops make immediately and does not build the main targets.
+
+.BEGIN:
+       false
+
+all:
+       : This is not made.



Home | Main Index | Thread Index | Old Index