]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - contrib/bmake/unit-tests/cond2.mk
- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
[FreeBSD/releng/10.3.git] / contrib / bmake / unit-tests / cond2.mk
1 # $Id: cond2.mk,v 1.1.1.2 2015/12/02 00:34:27 sjg Exp $
2
3 TEST_UNAME_S= NetBSD
4
5 # this should be ok
6 X:= ${${TEST_UNAME_S} == "NetBSD":?Ok:fail}
7 .if $X == "Ok"
8 Y= good
9 .endif
10 # expect: Bad conditional expression ` == "empty"' in  == "empty"?oops:ok
11 X:= ${${TEST_NOT_SET} == "empty":?oops:ok}
12 # expect: Malformed conditional ({TEST_TYPO} == "Ok")
13 .if {TEST_TYPO} == "Ok"
14 Y= oops
15 .endif
16 .if empty(TEST_NOT_SET)
17 Y!= echo TEST_NOT_SET is empty or not defined >&2; echo
18 .endif
19 # expect: Malformed conditional (${TEST_NOT_SET} == "empty")
20 .if ${TEST_NOT_SET} == "empty"
21 Y= oops
22 .endif
23
24 .if defined(.NDEF) && ${.NDEF} > 0
25 Z= yes
26 .endif
27
28 all:
29         @echo $@