Home | History | Annotate | Line # | Download | only in unit-tests
      1  1.6  rillig # $NetBSD: varname-make_print_var_on_error.mk,v 1.6 2021/02/04 21:33:14 rillig Exp $
      2  1.1  rillig #
      3  1.3  rillig # Tests for the special MAKE_PRINT_VAR_ON_ERROR variable, which prints the
      4  1.3  rillig # values of selected variables on error.
      5  1.1  rillig 
      6  1.4  rillig # XXX: As of 2020-10-23, the .ERROR_CMD variable is pointless in compat mode
      7  1.4  rillig # since at the point where it is filled in PrintOnError, the first command in
      8  1.4  rillig # gn->commands has been set to NULL already.  This leaves .ERROR_CMD an empty
      9  1.4  rillig # list.
     10  1.5  rillig #
     11  1.5  rillig # See also:
     12  1.5  rillig #	compat-error.mk
     13  1.5  rillig 
     14  1.6  rillig # XXX: As of 2021-02-04, PrintOnError calls Var_Subst with SCOPE_GLOBAL, which
     15  1.5  rillig # does not expand the node-local variables like .TARGET.  This results in the
     16  1.5  rillig # double '${.TARGET}' in the output.
     17  1.4  rillig 
     18  1.3  rillig MAKE_PRINT_VAR_ON_ERROR=	.ERROR_TARGET .ERROR_CMD
     19  1.1  rillig 
     20  1.1  rillig all:
     21  1.5  rillig 	@: before '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}'
     22  1.5  rillig 	echo fail ${.TARGET}; false '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}'
     23  1.5  rillig 	@: after '${.TARGET}' '$${.TARGET}' '$$$${.TARGET}'
     24