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 self-referenci...



details:   https://anonhg.NetBSD.org/src/rev/69eaedd42f13
branches:  trunk
changeset: 946097:69eaedd42f13
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 16 15:12:16 2020 +0000

description:
make(1): add test for self-referencing suffix rule

Just to ensure that make doesn't run into an endless loop.

diffstat:

 distrib/sets/lists/tests/mi           |   4 +++-
 usr.bin/make/unit-tests/Makefile      |   3 ++-
 usr.bin/make/unit-tests/suff-self.exp |   3 +++
 usr.bin/make/unit-tests/suff-self.mk  |  11 +++++++++++
 4 files changed, 19 insertions(+), 2 deletions(-)

diffs (57 lines):

diff -r 6b7076085f46 -r 69eaedd42f13 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Mon Nov 16 14:12:46 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Mon Nov 16 15:12:16 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.969 2020/11/14 15:35:20 rillig Exp $
+# $NetBSD: mi,v 1.970 2020/11/16 15:12:16 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5285,6 +5285,8 @@
 ./usr/tests/usr.bin/make/unit-tests/suff-main.mk                               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-rebuild.exp                           tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-rebuild.mk                            tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-self.exp                              tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-self.mk                               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-transform-endless.exp                 tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-transform-endless.mk                  tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-transform-expand.exp                  tests-usr.bin-tests     compattestfile,atf
diff -r 6b7076085f46 -r 69eaedd42f13 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Mon Nov 16 14:12:46 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Mon Nov 16 15:12:16 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.202 2020/11/15 20:50:46 rillig Exp $
+# $NetBSD: Makefile,v 1.203 2020/11/16 15:12:16 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -266,6 +266,7 @@
 TESTS+=                suff-lookup
 TESTS+=                suff-main
 TESTS+=                suff-rebuild
+TESTS+=                suff-self
 TESTS+=                suff-transform-endless
 TESTS+=                suff-transform-expand
 TESTS+=                suff-transform-select
diff -r 6b7076085f46 -r 69eaedd42f13 usr.bin/make/unit-tests/suff-self.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/suff-self.exp     Mon Nov 16 15:12:16 2020 +0000
@@ -0,0 +1,3 @@
+make: Graph cycles through suff-self.suff
+`all' not remade because of errors.
+exit status 0
diff -r 6b7076085f46 -r 69eaedd42f13 usr.bin/make/unit-tests/suff-self.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/suff-self.mk      Mon Nov 16 15:12:16 2020 +0000
@@ -0,0 +1,11 @@
+# $NetBSD: suff-self.mk,v 1.1 2020/11/16 15:12:16 rillig Exp $
+#
+# See what happens if someone defines a self-referencing suffix
+# transformation rule.
+
+.SUFFIXES: .suff
+
+.suff.suff:
+       : Making ${.TARGET} out of ${.IMPSRC}.
+
+all: suff-self.suff



Home | Main Index | Thread Index | Old Index