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 unintended "re...



details:   https://anonhg.NetBSD.org/src/rev/0214ea39fb10
branches:  trunk
changeset: 936845:0214ea39fb10
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 06 05:36:32 2020 +0000

description:
make(1): add test for unintended "recursive variable" in -dL mode

diffstat:

 distrib/sets/lists/tests/mi           |   4 +++-
 usr.bin/make/unit-tests/Makefile      |   5 ++++-
 usr.bin/make/unit-tests/recursive.exp |   4 ++++
 usr.bin/make/unit-tests/recursive.mk  |  22 ++++++++++++++++++++++
 4 files changed, 33 insertions(+), 2 deletions(-)

diffs (85 lines):

diff -r b18b3a9ac009 -r 0214ea39fb10 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Thu Aug 06 05:32:26 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Thu Aug 06 05:36:32 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.884 2020/08/03 15:43:31 rillig Exp $
+# $NetBSD: mi,v 1.885 2020/08/06 05:36:32 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4598,6 +4598,8 @@
 ./usr/tests/usr.bin/make/unit-tests/posix1.mk  tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/qequals.exp        tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/qequals.mk tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/recursive.exp      tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/recursive.mk       tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suffixes.exp       tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suffixes.mk        tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/sunshcmd.exp       tests-usr.bin-tests     compattestfile,atf
diff -r b18b3a9ac009 -r 0214ea39fb10 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Thu Aug 06 05:32:26 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Thu Aug 06 05:36:32 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.83 2020/08/03 15:43:32 rillig Exp $
+# $NetBSD: Makefile,v 1.84 2020/08/06 05:36:33 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -70,6 +70,7 @@
 TESTS+=                posix
 TESTS+=                # posix1        # broken by reverting POSIX changes
 TESTS+=                qequals
+TESTS+=                recursive
 TESTS+=                # suffixes      # broken by reverting POSIX changes
 TESTS+=                sunshcmd
 TESTS+=                sysv
@@ -90,6 +91,7 @@
 ENV.envfirst=          FROM_ENV=value-from-env
 ENV.export=            -i PATH=${PATH:Q}
 ENV.lint=              -i
+ENV.recursive=         -i
 ENV.varmisc=           FROM_ENV=env
 ENV.varmisc+=          FROM_ENV_BEFORE=env
 ENV.varmisc+=          FROM_ENV_AFTER=env
@@ -101,6 +103,7 @@
 FLAGS.export=          -r
 FLAGS.lint=            -dL -k
 FLAGS.order=           -j1
+FLAGS.recursive=       -dL
 FLAGS.vardebug=                -k -dv FROM_CMDLINE=
 
 # Some tests need extra post-processing.
diff -r b18b3a9ac009 -r 0214ea39fb10 usr.bin/make/unit-tests/recursive.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/recursive.exp     Thu Aug 06 05:36:32 2020 +0000
@@ -0,0 +1,4 @@
+Variable am__v_lt_ is recursive.
+
+make: stopped in unit-tests
+exit status 2
diff -r b18b3a9ac009 -r 0214ea39fb10 usr.bin/make/unit-tests/recursive.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/recursive.mk      Thu Aug 06 05:36:32 2020 +0000
@@ -0,0 +1,22 @@
+# $NetBSD: recursive.mk,v 1.1 2020/08/06 05:36:33 rillig Exp $
+#
+# In -dL mode, a variable may get expanded before it makes sense.
+# This would stop make from doing anything since the "recursive" error
+# is fatal and exits immediately.
+#
+# The purpose of evaluating that variable early was just to detect
+# whether there are unclosed variables.  It might be enough to parse the
+# variable value without VARE_WANTRES for that purpose.
+#
+# Seen in pkgsrc/x11/libXfixes, and probably many more package that use
+# GNU Automake.
+
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+am__v_lt_1 =
+libXfixes_la_LINK = ... $(AM_V_lt) ...
+.info not reached
+
+# somewhere later ...
+AM_DEFAULT_VERBOSITY = 1



Home | Main Index | Thread Index | Old Index