aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/directive-unexport.mk
blob: efc103efedf6344d0ec3ff5be4d618bbb60e4e0f (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
# $NetBSD: directive-unexport.mk,v 1.7 2020/12/13 01:07:54 rillig Exp $
#
# Tests for the .unexport directive.
#
# Before 2020-12-13, misspelled directives like ".unexporting" or
# ".unexport-en" had not been detected properly.
#
# See also:
#	directive-misspellings.mk

# First, export 3 variables.
UT_A=	a
UT_B=	b
UT_C=	c
.export UT_A UT_B UT_C

# Show the exported variables and their values.
.info ${:!env|sort|grep '^UT_'!}
.info ${.MAKE.EXPORTED}

# XXX: Now try to unexport all of them.  The variables are still exported
# but not mentioned in .MAKE.EXPORTED anymore.
# See the ":N" in Var_UnExport for the implementation.
*=	asterisk
.unexport *

.info ${:!env|sort|grep '^UT_'!}
.info ${.MAKE.EXPORTED}

.unexport			# oops: missing argument

all:
	@:;