summaryrefslogtreecommitdiffstats
path: root/contrib/bmake/unit-tests
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2017-06-13 00:22:15 +0000
committersjg <sjg@FreeBSD.org>2017-06-13 00:22:15 +0000
commit288f3738be6e27e220023bc4b7657fe85362d81d (patch)
tree40cf6f102891991aa2f8a183d5abb857ef42e453 /contrib/bmake/unit-tests
parent1017c991b1cd2684dcf01ef4801db4bfe18320b4 (diff)
downloadFreeBSD-src-288f3738be6e27e220023bc4b7657fe85362d81d.zip
FreeBSD-src-288f3738be6e27e220023bc4b7657fe85362d81d.tar.gz
Update bmake to 20170510
Approved by: re@
Diffstat (limited to 'contrib/bmake/unit-tests')
-rw-r--r--contrib/bmake/unit-tests/modmatch.exp3
-rw-r--r--contrib/bmake/unit-tests/modmatch.mk11
-rw-r--r--contrib/bmake/unit-tests/varmisc.exp5
-rw-r--r--contrib/bmake/unit-tests/varmisc.mk24
4 files changed, 40 insertions, 3 deletions
diff --git a/contrib/bmake/unit-tests/modmatch.exp b/contrib/bmake/unit-tests/modmatch.exp
index fcaf6c0..a7bf8b7 100644
--- a/contrib/bmake/unit-tests/modmatch.exp
+++ b/contrib/bmake/unit-tests/modmatch.exp
@@ -14,4 +14,7 @@ LIB=e X_LIBS:M${LIB${LIB:tu}} is "/tmp/libe.a"
LIB=e X_LIBS:M*/lib${LIB}.a is "/tmp/libe.a"
LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/LIBE.A"
Mscanner=OK
+Upper=One Two Three Four
+Lower=five six seven
+nose=One Three five
exit status 0
diff --git a/contrib/bmake/unit-tests/modmatch.mk b/contrib/bmake/unit-tests/modmatch.mk
index 48a1bef..4519928 100644
--- a/contrib/bmake/unit-tests/modmatch.mk
+++ b/contrib/bmake/unit-tests/modmatch.mk
@@ -15,7 +15,9 @@ res = no
res = OK
.endif
-all:
+all: show-libs check-cclass
+
+show-libs:
@for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done
@echo "Mscanner=${res}"
@@ -23,3 +25,10 @@ show:
@echo 'LIB=${LIB} X_LIBS:M$${LIB$${LIB:tu}} is "${X_LIBS:M${LIB${LIB:tu}}}"'
@echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a is "${X_LIBS:M*/lib${LIB}.a}"'
@echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a:tu is "${X_LIBS:M*/lib${LIB}.a:tu}"'
+
+LIST= One Two Three Four five six seven
+
+check-cclass:
+ @echo Upper=${LIST:M[A-Z]*}
+ @echo Lower=${LIST:M[^A-Z]*}
+ @echo nose=${LIST:M[^s]*[ex]}
diff --git a/contrib/bmake/unit-tests/varmisc.exp b/contrib/bmake/unit-tests/varmisc.exp
index e2af496..ffe8f8b 100644
--- a/contrib/bmake/unit-tests/varmisc.exp
+++ b/contrib/bmake/unit-tests/varmisc.exp
@@ -17,4 +17,9 @@ false
FALSE
do not evaluate or expand :? if discarding
is set
+year=2016 month=04 day=01
+date=20160401
+Version=123.456.789 == 123456789
+Literal=3.4.5 == 3004005
+We have target specific vars
exit status 0
diff --git a/contrib/bmake/unit-tests/varmisc.mk b/contrib/bmake/unit-tests/varmisc.mk
index 14b52d2..a0b8f2d 100644
--- a/contrib/bmake/unit-tests/varmisc.mk
+++ b/contrib/bmake/unit-tests/varmisc.mk
@@ -1,8 +1,9 @@
-# $Id: varmisc.mk,v 1.5 2015/10/12 17:10:48 sjg Exp $
+# $Id: varmisc.mk,v 1.9 2017/02/01 18:44:54 sjg Exp $
#
# Miscellaneous variable tests.
-all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none
+all: unmatched_var_paren D_true U_true D_false U_false Q_lhs Q_rhs NQ_none \
+ strftime cmpv
unmatched_var_paren:
@echo ${foo::=foo-text}
@@ -40,3 +41,22 @@ Q_rhs:
NQ_none:
@echo do not evaluate or expand :? if discarding
@echo ${VSET:U${1:L:?${True}:${False}}}
+
+April1= 1459494000
+
+# slightly contorted syntax to use utc via variable
+strftime:
+ @echo ${year=%Y month=%m day=%d:L:gmtime=1459494000}
+ @echo date=${%Y%m%d:L:${gmtime=${April1}:L}}
+
+# big jumps to handle 3 digits per step
+M_cmpv.units = 1 1000 1000000
+M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh
+
+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}
OpenPOWER on IntegriCloud