Module Name: src
Committed By: rillig
Date: Sat Aug 22 08:29:13 UTC 2020
Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: depsrc-usebefore-double-colon.exp
depsrc-usebefore-double-colon.mk
Log Message:
make(1): add test for combining :: and .USEBEFORE
To generate a diff of this commit:
cvs rdiff -u -r1.896 -r1.897 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.104 -r1.105 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 \
src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp \
src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.896 src/distrib/sets/lists/tests/mi:1.897
--- src/distrib/sets/lists/tests/mi:1.896 Thu Aug 20 21:28:01 2020
+++ src/distrib/sets/lists/tests/mi Sat Aug 22 08:29:13 2020
@@ -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
Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.104 src/usr.bin/make/unit-tests/Makefile:1.105
--- src/usr.bin/make/unit-tests/Makefile:1.104 Thu Aug 20 18:05:57 2020
+++ src/usr.bin/make/unit-tests/Makefile Sat Aug 22 08:29:13 2020
@@ -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-recursive
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 @@ sync-mi:
@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
Added files:
Index: src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp
diff -u /dev/null src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp:1.1
--- /dev/null Sat Aug 22 08:29:14 2020
+++ src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.exp Sat Aug 22 08:29:13 2020
@@ -0,0 +1,2 @@
+double-colon early 1
+exit status 0
Index: src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk
diff -u /dev/null src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk:1.1
--- /dev/null Sat Aug 22 08:29:14 2020
+++ src/usr.bin/make/unit-tests/depsrc-usebefore-double-colon.mk Sat Aug 22 08:29:13 2020
@@ -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