diff options
Diffstat (limited to 'contrib/bmake/unit-tests/directive-export-gmake.mk')
-rw-r--r-- | contrib/bmake/unit-tests/directive-export-gmake.mk | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/contrib/bmake/unit-tests/directive-export-gmake.mk b/contrib/bmake/unit-tests/directive-export-gmake.mk index f7a617ab7553..de79470bf305 100644 --- a/contrib/bmake/unit-tests/directive-export-gmake.mk +++ b/contrib/bmake/unit-tests/directive-export-gmake.mk @@ -1,4 +1,4 @@ -# $NetBSD: directive-export-gmake.mk,v 1.7 2023/08/20 20:48:32 rillig Exp $ +# $NetBSD: directive-export-gmake.mk,v 1.9 2023/12/17 09:44:00 rillig Exp $ # # Tests for the export directive (without leading dot), as in GNU make. @@ -67,7 +67,7 @@ export VAR=an ${UNDEF} variable .for value in 1 # XXX: The ':' in this line is inside an expression and should thus not be # interpreted as a dependency operator. -# expect+1: Invalid line 'export VAR=${:U1}' +# expect+1: Invalid line 'export VAR=${:U1}', expanded to 'export VAR=1' export VAR=${value} .endfor @@ -83,3 +83,24 @@ INDIRECT_TZ= ${:UAmerica/Los_Angeles} export TZ=${INDIRECT_TZ} # expect+1: 16:00:00 .info ${%T:L:localtime=86400} + + +# The '=' must be present in the unexpanded line, it cannot be generated by +# an expression. +EQ= = +# expect+1: Variable/Value missing from "export" +export EQ_VAR${EQ}eq-value +.if ${:!env!:MEQ_VAR=*} +. error +.endif + + +# The variable name must be given directly, it is not expanded. The name of +# the exported variable thus starts with a '$', and that name may be filtered +# out by the platform. +INDIRECT_NAME= I_NAME +INDIRECT_VALUE= indirect value +export ${INDIRECT_NAME}=${INDIRECT_VALUE} +.if ${:!env!:MI_NAME=*} +. error +.endif |