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