]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/export-variants.mk
Update to bmake-20200902
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / export-variants.mk
1 # $NetBSD: export-variants.mk,v 1.2 2020/08/08 13:00:07 rillig Exp $
2 #
3 # Test whether exported variables apply to each variant of running
4 # external commands:
5 #
6 # The != assignments.
7 # The :!cmd! modifier.
8 # The :sh modifier.
9
10 SHVAR!= env | grep ^UT_ || true
11 .if ${SHVAR} != ""
12 .warning At this point, no variable should be exported.
13 .endif
14
15 .if ${:!env | grep ^UT_ || true!} != ""
16 .warning At this point, no variable should be exported.
17 .endif
18
19 .if ${env | grep ^UT_ || true:L:sh} != ""
20 .warning At this point, no variable should be exported.
21 .endif
22
23 UT_VAR=         value
24 .export UT_VAR
25
26 SHVAR!= env | grep ^UT_ || true
27 .if ${SHVAR} != "UT_VAR=value"
28 .warning At this point, no variable should be exported.
29 .endif
30
31 .if ${:!env | grep ^UT_ || true!} != "UT_VAR=value"
32 .warning At this point, some variables should be exported.
33 .endif
34
35 .if ${env | grep ^UT_ || true:L:sh} != "UT_VAR=value"
36 .warning At this point, some variables should be exported.
37 .endif
38
39 all:
40         @:;