freebsd-src/unit-tests/directive-export.mk
Simon J. Gerraty 1b65f0bd2b Import bmake-20201117
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o Fix building and unit-tests on non-BSD.

o More code cleanup and refactoring.

o More unit tests
2020-11-20 03:54:37 +00:00

32 lines
741 B
Makefile

# $NetBSD: directive-export.mk,v 1.4 2020/11/03 17:17:31 rillig Exp $
#
# Tests for the .export directive.
# TODO: Implementation
INDIRECT= indirect
VAR= value $$ ${INDIRECT}
# A variable is exported using the .export directive.
# During that, its value is expanded, just like almost everywhere else.
.export VAR
.if ${:!env | grep '^VAR'!} != "VAR=value \$ indirect"
. error
.endif
# Undefining a variable that has been exported implicitly removes it from
# the environment of all child processes.
.undef VAR
.if ${:!env | grep '^VAR' || true!} != ""
. error
.endif
# Tests for parsing the .export directive.
.expor # misspelled
.export # oops: missing argument
.export VARNAME
.exporting works # oops: misspelled
all:
@:;