]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/cmd-errors-lint.mk
Merge bmake-20201117
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / cmd-errors-lint.mk
1 # $NetBSD: cmd-errors-lint.mk,v 1.1 2020/11/02 20:43:27 rillig Exp $
2 #
3 # Demonstrate how errors in variable expansions affect whether the commands
4 # are actually executed.
5
6 .MAKEFLAGS: -dL
7
8 all: undefined unclosed-variable unclosed-modifier unknown-modifier end
9
10 # Undefined variables are not an error.  They expand to empty strings.
11 undefined:
12         : $@ ${UNDEFINED}
13
14 # XXX: As of 2020-11-01, this obvious syntax error is not detected.
15 # XXX: As of 2020-11-01, this command is executed even though it contains
16 # parse errors.
17 unclosed-variable:
18         : $@ ${UNCLOSED
19
20 # XXX: As of 2020-11-01, this obvious syntax error is not detected.
21 # XXX: As of 2020-11-01, this command is executed even though it contains
22 # parse errors.
23 unclosed-modifier:
24         : $@ ${UNCLOSED:
25
26 # XXX: As of 2020-11-01, this command is executed even though it contains
27 # parse errors.
28 unknown-modifier:
29         : $@ ${UNKNOWN:Z}
30
31 end:
32         : $@