Module Name: src
Committed By: sjg
Date: Tue Jan 31 18:56:35 UTC 2017
Modified Files:
src/usr.bin/make/unit-tests: varmisc.exp varmisc.mk
Log Message:
Add check to cmpv test to ensure that target specific vars with
modifiers work as expected.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmisc.exp
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmisc.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/varmisc.exp
diff -u src/usr.bin/make/unit-tests/varmisc.exp:1.6 src/usr.bin/make/unit-tests/varmisc.exp:1.7
--- src/usr.bin/make/unit-tests/varmisc.exp:1.6 Mon Jan 30 02:46:20 2017
+++ src/usr.bin/make/unit-tests/varmisc.exp Tue Jan 31 18:56:35 2017
@@ -19,6 +19,7 @@ do not evaluate or expand :? if discardi
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
Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.7 src/usr.bin/make/unit-tests/varmisc.mk:1.8
--- src/usr.bin/make/unit-tests/varmisc.mk:1.7 Mon Jan 30 02:46:20 2017
+++ src/usr.bin/make/unit-tests/varmisc.mk Tue Jan 31 18:56:35 2017
@@ -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 @@ strftime:
@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}