aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/export-variants.mk
blob: fdbbccccc6c69007651d911600c3551bfa9ed972 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# $NetBSD: export-variants.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
#
# Test whether exported variables apply to each variant of running
# external commands:
#
# The != assignments.
# The :!cmd! modifier.
# The :sh modifier.

SHVAR!=	env | grep ^UT_ || true
.if ${SHVAR} != ""
.  warning At this point, no variable should be exported.
.endif

.if ${:!env | grep ^UT_ || true!} != ""
.  warning At this point, no variable should be exported.
.endif

.if ${env | grep ^UT_ || true:L:sh} != ""
.  warning At this point, no variable should be exported.
.endif

UT_VAR=		value
.export UT_VAR

SHVAR!=	env | grep ^UT_ || true
.if ${SHVAR} != "UT_VAR=value"
.  warning At this point, a single variable should be exported.
.endif

.if ${:!env | grep ^UT_ || true!} != "UT_VAR=value"
.  warning At this point, a single variable should be exported.
.endif

.if ${env | grep ^UT_ || true:L:sh} != "UT_VAR=value"
.  warning At this point, a single variable should be exported.
.endif

all:
	@:;