Home | History | Annotate | Line # | Download | only in unit-tests
directive-unexport.mk revision 1.6
      1 # $NetBSD: directive-unexport.mk,v 1.6 2020/12/12 18:11:42 rillig Exp $
      2 #
      3 # Tests for the .unexport directive.
      4 #
      5 # Before 2020-12-13, misspelled directives like ".unexporting" or
      6 # ".unexport-en" had not been detected properly.
      7 
      8 # First, export 3 variables.
      9 UT_A=	a
     10 UT_B=	b
     11 UT_C=	c
     12 .export UT_A UT_B UT_C
     13 
     14 # Show the exported variables and their values.
     15 .info ${:!env|sort|grep '^UT_'!}
     16 .info ${.MAKE.EXPORTED}
     17 
     18 # XXX: Now try to unexport all of them.  The variables are still exported
     19 # but not mentioned in .MAKE.EXPORTED anymore.
     20 # See the ":N" in Var_UnExport for the implementation.
     21 *=	asterisk
     22 .unexport *
     23 
     24 .info ${:!env|sort|grep '^UT_'!}
     25 .info ${.MAKE.EXPORTED}
     26 
     27 .unexpor			# misspelled
     28 .unexport			# oops: missing argument
     29 .unexporting works		# misspelled
     30 
     31 all:
     32 	@:;
     33