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): demonstrate wrong error han...
details: https://anonhg.NetBSD.org/src/rev/032eb233b284
branches: trunk
changeset: 957874:032eb233b284
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Dec 13 17:44:31 2020 +0000
description:
make(1): demonstrate wrong error handling in compat mode
diffstat:
distrib/sets/lists/tests/mi | 4 ++-
usr.bin/make/unit-tests/Makefile | 3 +-
usr.bin/make/unit-tests/compat-error.exp | 15 ++++++++++++++
usr.bin/make/unit-tests/compat-error.mk | 33 ++++++++++++++++++++++++++++++++
4 files changed, 53 insertions(+), 2 deletions(-)
diffs (91 lines):
diff -r 894f300983c9 -r 032eb233b284 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sun Dec 13 16:50:47 2020 +0000
+++ b/distrib/sets/lists/tests/mi Sun Dec 13 17:44:31 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.992 2020/12/13 00:46:25 rillig Exp $
+# $NetBSD: mi,v 1.993 2020/12/13 17:44:31 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4830,6 +4830,8 @@
./usr/tests/usr.bin/make/unit-tests/cmdline.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/comment.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/comment.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/compat-error.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/compat-error.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-eq.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric-ge.exp tests-usr.bin-tests compattestfile,atf
diff -r 894f300983c9 -r 032eb233b284 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Sun Dec 13 16:50:47 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Sun Dec 13 17:44:31 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.248 2020/12/13 05:13:38 sjg Exp $
+# $NetBSD: Makefile,v 1.249 2020/12/13 17:44:31 rillig Exp $
#
# Unit tests for make(1)
#
@@ -46,6 +46,7 @@
TESTS+= cmdline
TESTS+= cmdline-undefined
TESTS+= comment
+TESTS+= compat-error
TESTS+= cond-cmp-numeric
TESTS+= cond-cmp-numeric-eq
TESTS+= cond-cmp-numeric-ge
diff -r 894f300983c9 -r 032eb233b284 usr.bin/make/unit-tests/compat-error.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/compat-error.exp Sun Dec 13 17:44:31 2020 +0000
@@ -0,0 +1,15 @@
+: Making success1 out of nothing.
+: Making fail1 out of nothing.
+false
+*** Error code 1 (continuing)
+: Making success2 out of nothing.
+: Making fail2 out of nothing.
+false
+*** Error code 1 (continuing)
+: Making success3 out of nothing.
+
+Stop.
+make: stopped in unit-tests
+target: success3
+command:
+exit status 1
diff -r 894f300983c9 -r 032eb233b284 usr.bin/make/unit-tests/compat-error.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/compat-error.mk Sun Dec 13 17:44:31 2020 +0000
@@ -0,0 +1,33 @@
+# $NetBSD: compat-error.mk,v 1.1 2020/12/13 17:44:31 rillig Exp $
+#
+# Test detailed error handling in compat mode.
+#
+# XXX: As of 2020-12-13, .ERROR_TARGET is success3, which is wrong.
+#
+# XXX: As of 2020-12-13, .ERROR_CMD is empty, which is wrong.
+#
+# See also:
+# Compat_Run
+#
+# The commit that added the NULL command to gn->commands:
+# CVS: 1994.06.06.22.45.??
+# Git: 26a8972fd7f982502c5fbfdabd34578b99d77ca5
+# 1994: Lst_Replace (cmdNode, (ClientData) NULL);
+# 2020: LstNode_SetNull(cmdNode);
+#
+# The commit that skipped NULL commands for .ERROR_CMD:
+# CVS: 2016.08.11.19.53.??
+# Git: 58b23478b7353d46457089e726b07a49197388e4
+
+.MAKEFLAGS: success1 fail1 success2 fail2 success3
+
+success1 success2 success3:
+ : Making ${.TARGET} out of nothing.
+
+fail1 fail2:
+ : Making ${.TARGET} out of nothing.
+ false
+
+.ERROR:
+ @echo target: ${.ERROR_TARGET}
+ @echo command: ${.ERROR_CMD}
Home |
Main Index |
Thread Index |
Old Index