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 combining :: a...
details: https://anonhg.NetBSD.org/src/rev/1a6e1a48af3e
branches: trunk
changeset: 937588:1a6e1a48af3e
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Aug 22 08:29:13 2020 +0000
description:
make(1): add test for combining :: and .USEBEFORE
diffstat:
distrib/sets/lists/tests/mi | 6 +-
usr.bin/make/unit-tests/Makefile | 4 +-
usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp | 2 +
usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk | 30 +++++++++++++++
4 files changed, 38 insertions(+), 4 deletions(-)
diffs (92 lines):
diff -r 04f20dcc88bf -r 1a6e1a48af3e distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sat Aug 22 08:08:47 2020 +0000
+++ b/distrib/sets/lists/tests/mi Sat Aug 22 08:29:13 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.896 2020/08/20 21:28:01 riastradh Exp $
+# $NetBSD: mi,v 1.897 2020/08/22 08:29:13 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4627,6 +4627,8 @@
./usr/tests/usr.bin/make/unit-tests/depsrc-silent.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-use.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-use.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-usebefore.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-wait.exp tests-usr.bin-tests compattestfile,atf
@@ -4771,8 +4773,6 @@
./usr/tests/usr.bin/make/unit-tests/modmatch.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/modmisc.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/modmisc.mk tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/make/unit-tests/modorder.exp tests-obsolete obsolete
-./usr/tests/usr.bin/make/unit-tests/modorder.mk tests-obsolete obsolete
./usr/tests/usr.bin/make/unit-tests/modts.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/modts.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/modword.exp tests-usr.bin-tests compattestfile,atf
diff -r 04f20dcc88bf -r 1a6e1a48af3e usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Sat Aug 22 08:08:47 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile Sat Aug 22 08:29:13 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.104 2020/08/20 18:05:57 rillig Exp $
+# $NetBSD: Makefile,v 1.105 2020/08/22 08:29:13 rillig Exp $
#
# Unit tests for make(1)
#
@@ -83,6 +83,7 @@
TESTS+= depsrc-silent
TESTS+= depsrc-use
TESTS+= depsrc-usebefore
+TESTS+= depsrc-usebefore-double-colon
TESTS+= depsrc-wait
TESTS+= deptgt
TESTS+= deptgt-begin
@@ -436,6 +437,7 @@
@set -eu; \
cd "${MAKEFILE:tA:H}/../../.."; \
mi="distrib/sets/lists/tests/mi"; \
+ cvs update "$$mi"; \
awk ${SYNC_MI_AWK:Q} < "$$mi" > "$$mi.$@"; \
mv -f "$$mi.$@" "$$mi"; \
cvs diff "$$mi" || true
diff -r 04f20dcc88bf -r 1a6e1a48af3e usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp Sat Aug 22 08:29:13 2020 +0000
@@ -0,0 +1,2 @@
+double-colon early 1
+exit status 0
diff -r 04f20dcc88bf -r 1a6e1a48af3e usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk Sat Aug 22 08:29:13 2020 +0000
@@ -0,0 +1,30 @@
+# $NetBSD: depsrc-usebefore-double-colon.mk,v 1.1 2020/08/22 08:29:13 rillig Exp $
+#
+# Tests for the special source .USEBEFORE in dependency declarations,
+# combined with the double-colon dependency operator.
+
+all: action
+
+# The dependency operator :: allows commands to be added later to the same
+# target.
+double-colon:: .USEBEFORE
+ @echo double-colon early 1
+
+# This command is ignored, which kind of makes sense since this dependency
+# declaration has no .USEBEFORE source.
+double-colon::
+ @echo double-colon early 2
+
+# XXX: This command is ignored even though it has a .USEBEFORE source.
+# This is unexpected.
+double-colon:: .USEBEFORE
+ @echo double-colon early 3
+
+# At this point, the commands from the .USEBEFORE targets are copied to
+# the "action" target.
+action: double-colon
+
+# This command is not added to the "action" target since it comes too late.
+# The commands had been copied in the previous line already.
+double-colon::
+ @echo double-colon late
Home |
Main Index |
Thread Index |
Old Index