aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/opt-x-reduce-exported.mk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bmake/unit-tests/opt-x-reduce-exported.mk')
-rw-r--r--contrib/bmake/unit-tests/opt-x-reduce-exported.mk22
1 files changed, 17 insertions, 5 deletions
diff --git a/contrib/bmake/unit-tests/opt-x-reduce-exported.mk b/contrib/bmake/unit-tests/opt-x-reduce-exported.mk
index 7ee8e7c7eff0..a42a85d21a53 100644
--- a/contrib/bmake/unit-tests/opt-x-reduce-exported.mk
+++ b/contrib/bmake/unit-tests/opt-x-reduce-exported.mk
@@ -1,8 +1,20 @@
-# $NetBSD: opt-x-reduce-exported.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: opt-x-reduce-exported.mk,v 1.3 2022/05/08 07:27:50 rillig Exp $
#
-# Tests for the -x command line option.
+# Tests for the -X command line option, which prevents variables passed on the
+# command line from being exported to the environment of child commands.
-# TODO: Implementation
+# The variable 'BEFORE' is exported, the variable 'AFTER' isn't.
+.MAKEFLAGS: BEFORE=before -X AFTER=after
-all:
- @:;
+all: .PHONY ordinary submake
+
+ordinary: .PHONY
+ @echo 'ordinary:'
+ @env | sort | grep -e '^BEFORE' -e '^AFTER'
+
+submake: .PHONY
+ @echo 'submake:'
+ @${MAKE} -r -f ${MAKEFILE} show-env
+
+show-env: .PHONY
+ @env | sort | grep -e '^BEFORE' -e '^AFTER'