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 prefix mismatc...



details:   https://anonhg.NetBSD.org/src/rev/3d79b96a5e48
branches:  trunk
changeset: 974211:3d79b96a5e48
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 26 11:19:04 2020 +0000

description:
make(1): add test for prefix mismatch in SysV substitution

diffstat:

 usr.bin/make/unit-tests/sysv.exp |  2 ++
 usr.bin/make/unit-tests/sysv.mk  |  9 ++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r 848a9a21c83a -r 3d79b96a5e48 usr.bin/make/unit-tests/sysv.exp
--- a/usr.bin/make/unit-tests/sysv.exp  Sun Jul 26 11:10:29 2020 +0000
+++ b/usr.bin/make/unit-tests/sysv.exp  Sun Jul 26 11:19:04 2020 +0000
@@ -17,4 +17,6 @@
 &
 anchor-dollar: value
 anchor-dollar: valux
+mismatch: file.cpp file.h
+mismatch: renamed.c other.c
 exit status 0
diff -r 848a9a21c83a -r 3d79b96a5e48 usr.bin/make/unit-tests/sysv.mk
--- a/usr.bin/make/unit-tests/sysv.mk   Sun Jul 26 11:10:29 2020 +0000
+++ b/usr.bin/make/unit-tests/sysv.mk   Sun Jul 26 11:19:04 2020 +0000
@@ -1,6 +1,7 @@
-# $Id: sysv.mk,v 1.8 2020/07/20 16:27:55 rillig Exp $
+# $Id: sysv.mk,v 1.9 2020/07/26 11:19:04 rillig Exp $
 
 all: foo fun sam bla words ampersand anchor-dollar
+all: mismatch
 
 FOO ?=
 FOOBAR = ${FOO:=bar}
@@ -61,3 +62,9 @@
 anchor-dollar:
        @echo $@: ${:U${value:L:e$=x}:Q}
        @echo $@: ${:U${value:L:e=x}:Q}
+
+# Words that don't match are copied unmodified.
+# The % placeholder can be anywhere in the string.
+mismatch:
+       @echo $@: ${:Ufile.c file.h:%.c=%.cpp}
+       @echo $@: ${:Ufile.c other.c:file.%=renamed.%}



Home | Main Index | Thread Index | Old Index