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 Add check to cmpv test to ensure tha...
details: https://anonhg.NetBSD.org/src/rev/b5ce85ba26ad
branches: trunk
changeset: 351038:b5ce85ba26ad
user: sjg <sjg%NetBSD.org@localhost>
date: Tue Jan 31 18:56:35 2017 +0000
description:
Add check to cmpv test to ensure that target specific vars with
modifiers work as expected.
diffstat:
usr.bin/make/unit-tests/varmisc.exp | 5 +++--
usr.bin/make/unit-tests/varmisc.mk | 9 +++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diffs (39 lines):
diff -r 3c487cadde9e -r b5ce85ba26ad usr.bin/make/unit-tests/varmisc.exp
--- a/usr.bin/make/unit-tests/varmisc.exp Tue Jan 31 17:38:54 2017 +0000
+++ b/usr.bin/make/unit-tests/varmisc.exp Tue Jan 31 18:56:35 2017 +0000
@@ -19,6 +19,7 @@
is set
year=2016 month=04 day=01
date=20160401
-Version=1.2.3 == 10203
-Literal=3.4.5 == 30405
+Version=123.456.789 == 123456789
+Literal=3.4.5 == 3004005
+We have target specific vars
exit status 0
diff -r 3c487cadde9e -r b5ce85ba26ad usr.bin/make/unit-tests/varmisc.mk
--- a/usr.bin/make/unit-tests/varmisc.mk Tue Jan 31 17:38:54 2017 +0000
+++ b/usr.bin/make/unit-tests/varmisc.mk Tue Jan 31 18:56:35 2017 +0000
@@ -1,4 +1,4 @@
-# $Id: varmisc.mk,v 1.7 2017/01/30 02:46:20 sjg Exp $
+# $Id: varmisc.mk,v 1.8 2017/01/31 18:56:35 sjg Exp $
#
# Miscellaneous variable tests.
@@ -50,12 +50,13 @@
@echo date=${%Y%m%d:L:${gmtime=${April1}:L}}
# big jumps to handle 3 digits per step
-M_cmpv.units = 1 100 10000 1000000
-# this will produce the same result as the .for loop below
+M_cmpv.units = 1 1000 1000000
M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh
-Version = 1.2.3
+Version = 123.456.789
+cmpv.only = target specific vars
cmpv:
@echo Version=${Version} == ${Version:${M_cmpv}}
@echo Literal=3.4.5 == ${3.4.5:L:${M_cmpv}}
+ @echo We have ${${.TARGET:T}.only}
Home |
Main Index |
Thread Index |
Old Index