Module Name: src
Committed By: rillig
Date: Tue Nov 24 19:02:59 UTC 2020
Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: deptgt-begin-fail-indirect.exp
deptgt-begin-fail-indirect.mk deptgt-begin-fail.exp
deptgt-begin-fail.mk
Log Message:
make(1): add test for bug in error handling of .BEGIN in -k mode
To generate a diff of this commit:
cvs rdiff -u -r1.977 -r1.978 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.223 -r1.224 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 \
src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp \
src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk \
src/usr.bin/make/unit-tests/deptgt-begin-fail.exp \
src/usr.bin/make/unit-tests/deptgt-begin-fail.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.977 src/distrib/sets/lists/tests/mi:1.978
--- src/distrib/sets/lists/tests/mi:1.977 Tue Nov 24 17:59:42 2020
+++ src/distrib/sets/lists/tests/mi Tue Nov 24 19:02:59 2020
@@ -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
Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.223 src/usr.bin/make/unit-tests/Makefile:1.224
--- src/usr.bin/make/unit-tests/Makefile:1.223 Tue Nov 24 17:59:42 2020
+++ src/usr.bin/make/unit-tests/Makefile Tue Nov 24 19:02:59 2020
@@ -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-usebefore-double-colon
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
Added files:
Index: src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp
diff -u /dev/null src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp:1.1
--- /dev/null Tue Nov 24 19:02:59 2020
+++ src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.exp Tue Nov 24 19:02:59 2020
@@ -0,0 +1,4 @@
+false
+*** Error code 1 (continuing)
+: This is not made.
+exit status 0
Index: src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk
diff -u /dev/null src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk:1.1
--- /dev/null Tue Nov 24 19:02:59 2020
+++ src/usr.bin/make/unit-tests/deptgt-begin-fail-indirect.mk Tue Nov 24 19:02:59 2020
@@ -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.
Index: src/usr.bin/make/unit-tests/deptgt-begin-fail.exp
diff -u /dev/null src/usr.bin/make/unit-tests/deptgt-begin-fail.exp:1.1
--- /dev/null Tue Nov 24 19:02:59 2020
+++ src/usr.bin/make/unit-tests/deptgt-begin-fail.exp Tue Nov 24 19:02:59 2020
@@ -0,0 +1,6 @@
+false
+*** Error code 1 (continuing)
+
+Stop.
+make: stopped in unit-tests
+exit status 1
Index: src/usr.bin/make/unit-tests/deptgt-begin-fail.mk
diff -u /dev/null src/usr.bin/make/unit-tests/deptgt-begin-fail.mk:1.1
--- /dev/null Tue Nov 24 19:02:59 2020
+++ src/usr.bin/make/unit-tests/deptgt-begin-fail.mk Tue Nov 24 19:02:59 2020
@@ -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.