NetBSD/usr.bin/make/unit-tests/cond2.exp
sjg ca0319bf7c When evaluating condtionals from .if we want to require
that the lhs is a variable reference, a number or a quoted string.
This helps avoid subtle bugs caused by typos.

When conditionals are being evaluated during variable expansion
we cannot be as strict becuase lhs will already have been expanded.

We therefor pass a boolean to Cond_EvalExpression to tell it how
lhs should be treated.

Add unit-tests/cond2.mk to test the above

Reviewed by: christos, joerg
2015-05-05 21:51:09 +00:00

8 lines
346 B
Plaintext

make: Bad conditional expression ` == "empty"' in == "empty"?oops:ok
make: "cond2.mk" line 13: Malformed conditional ({TEST_TYPO} == "Ok")
TEST_NOT_SET is empty or not defined
make: "cond2.mk" line 20: Malformed conditional (${TEST_NOT_SET} == "empty")
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1