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): extend test for .USEBEFORE



details:   https://anonhg.NetBSD.org/src/rev/857934369a62
branches:  trunk
changeset: 975135:857934369a62
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 22 11:53:18 2020 +0000

description:
make(1): extend test for .USEBEFORE

When several .USEBEFORE targets are added to another target, they are
added in reverse order.  But the commands of each .USEBEFORE target are
added in normal order.

diffstat:

 usr.bin/make/unit-tests/depsrc-usebefore.exp |   6 ++++--
 usr.bin/make/unit-tests/depsrc-usebefore.mk  |  12 +++++++-----
 2 files changed, 11 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r fd0d2e46b730 -r 857934369a62 usr.bin/make/unit-tests/depsrc-usebefore.exp
--- a/usr.bin/make/unit-tests/depsrc-usebefore.exp      Sat Aug 22 11:35:00 2020 +0000
+++ b/usr.bin/make/unit-tests/depsrc-usebefore.exp      Sat Aug 22 11:53:18 2020 +0000
@@ -1,4 +1,6 @@
-first
-second
+first 1
+first 2
+second 1
+second 2
 directly
 exit status 0
diff -r fd0d2e46b730 -r 857934369a62 usr.bin/make/unit-tests/depsrc-usebefore.mk
--- a/usr.bin/make/unit-tests/depsrc-usebefore.mk       Sat Aug 22 11:35:00 2020 +0000
+++ b/usr.bin/make/unit-tests/depsrc-usebefore.mk       Sat Aug 22 11:53:18 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: depsrc-usebefore.mk,v 1.4 2020/08/22 07:49:44 rillig Exp $
+# $NetBSD: depsrc-usebefore.mk,v 1.5 2020/08/22 11:53:18 rillig Exp $
 #
 # Tests for the special source .USEBEFORE in dependency declarations,
 # which allows to prepend common commands to other targets.
@@ -6,16 +6,18 @@
 all: action directly
 
 first: .USEBEFORE
-       @echo first             # Using ${.TARGET} here would expand to "action"
+       @echo first 1           # Using ${.TARGET} here would expand to "action"
+       @echo first 2           # Using ${.TARGET} here would expand to "action"
 
 second: .USEBEFORE
-       @echo second
+       @echo second 1
+       @echo second 2
 
-# It's possible but uncommon to have a .USEBEFORE target with no commands.
+# It is possible but uncommon to have a .USEBEFORE target with no commands.
 # This may happen as the result of expanding a .for loop.
 empty: .USEBEFORE
 
-# It's possible but uncommon to directly make a .USEBEFORE target.
+# It is possible but uncommon to directly make a .USEBEFORE target.
 directly: .USEBEFORE
        @echo directly
 



Home | Main Index | Thread Index | Old Index