Home | History | Annotate | Line # | Download | only in unit-tests
directive-export.mk revision 1.3
      1  1.3  rillig # $NetBSD: directive-export.mk,v 1.3 2020/10/29 17:27:12 rillig Exp $
      2  1.1  rillig #
      3  1.2  rillig # Tests for the .export directive.
      4  1.1  rillig 
      5  1.1  rillig # TODO: Implementation
      6  1.1  rillig 
      7  1.3  rillig INDIRECT=	indirect
      8  1.3  rillig VAR=		value $$ ${INDIRECT}
      9  1.3  rillig 
     10  1.3  rillig # A variable is exported using the .export directive.
     11  1.3  rillig # During that, its value is expanded, just like almost everywhere else.
     12  1.3  rillig .export VAR
     13  1.3  rillig .if ${:!env | grep '^VAR'!} != "VAR=value \$ indirect"
     14  1.3  rillig .  error
     15  1.3  rillig .endif
     16  1.3  rillig 
     17  1.3  rillig # Undefining a variable that has been exported implicitly removes it from
     18  1.3  rillig # the environment of all child processes.
     19  1.3  rillig .undef VAR
     20  1.3  rillig .if ${:!env | grep '^VAR' || true!} != ""
     21  1.3  rillig .  error
     22  1.3  rillig .endif
     23  1.3  rillig 
     24  1.1  rillig all:
     25  1.1  rillig 	@:;
     26