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 case in which .BEG...



details:   https://anonhg.NetBSD.org/src/rev/f7aec09ea685
branches:  trunk
changeset: 1015443:f7aec09ea685
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Oct 23 19:23:00 2020 +0000

description:
make(1): add test case in which .BEGIN depends on .END

Just for fun.

diffstat:

 distrib/sets/lists/tests/mi            |   4 +++-
 usr.bin/make/unit-tests/Makefile       |   3 ++-
 usr.bin/make/unit-tests/depsrc-end.exp |   4 ++++
 usr.bin/make/unit-tests/depsrc-end.mk  |  14 ++++++++++++++
 4 files changed, 23 insertions(+), 2 deletions(-)

diffs (61 lines):

diff -r df8e338d6f97 -r f7aec09ea685 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Fri Oct 23 19:11:30 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Fri Oct 23 19:23:00 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.947 2020/10/23 19:11:30 rillig Exp $
+# $NetBSD: mi,v 1.948 2020/10/23 19:23:00 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4641,6 +4641,8 @@
 ./usr/tests/usr.bin/make/unit-tests/dep-wildcards.mk                           tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/dep.exp                                    tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/dep.mk                                     tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/depsrc-end.exp                             tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/depsrc-end.mk                              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/depsrc-exec.exp                            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/depsrc-exec.mk                             tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/depsrc-ignore.exp                          tests-usr.bin-tests     compattestfile,atf
diff -r df8e338d6f97 -r f7aec09ea685 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Fri Oct 23 19:11:30 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Fri Oct 23 19:23:00 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.172 2020/10/23 19:11:30 rillig Exp $
+# $NetBSD: Makefile,v 1.173 2020/10/23 19:23:01 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -81,6 +81,7 @@
 TESTS+=                dep-var
 TESTS+=                dep-wildcards
 TESTS+=                depsrc
+TESTS+=                depsrc-end
 TESTS+=                depsrc-exec
 TESTS+=                depsrc-ignore
 TESTS+=                depsrc-made
diff -r df8e338d6f97 -r f7aec09ea685 usr.bin/make/unit-tests/depsrc-end.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/depsrc-end.exp    Fri Oct 23 19:23:00 2020 +0000
@@ -0,0 +1,4 @@
+: 'Making .END.'
+: 'Making .BEGIN.'
+: 'Making all.'
+exit status 0
diff -r df8e338d6f97 -r f7aec09ea685 usr.bin/make/unit-tests/depsrc-end.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/depsrc-end.mk     Fri Oct 23 19:23:00 2020 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: depsrc-end.mk,v 1.1 2020/10/23 19:23:01 rillig Exp $
+#
+# Demonstrate the edge case that .BEGIN depends on .END, which sounds a bit
+# paradox but works since these special nodes are not in the dependency
+# hierarchy where the cycles are detected.
+
+.BEGIN:
+       : 'Making ${.TARGET}.'
+.END:
+       : 'Making ${.TARGET}.'
+all:
+       : 'Making ${.TARGET}.'
+
+.BEGIN: .END



Home | Main Index | Thread Index | Old Index