Home | History | Annotate | Line # | Download | only in unit-tests
cmd-errors.mk revision 1.5
      1 # $NetBSD: cmd-errors.mk,v 1.5 2022/09/25 12:51:37 rillig Exp $
      2 #
      3 # Demonstrate how errors in variable expansions affect whether the commands
      4 # are actually executed in compat mode.
      5 
      6 all: undefined unclosed-variable unclosed-modifier unknown-modifier end
      7 
      8 # Undefined variables are not an error.  They expand to empty strings.
      9 undefined:
     10 	: $@-${UNDEFINED}-eol
     11 
     12 # XXX: As of 2020-11-01, this command is executed even though it contains
     13 # parse errors.
     14 unclosed-variable:
     15 	: $@-${UNCLOSED
     16 
     17 # XXX: As of 2020-11-01, this command is executed even though it contains
     18 # parse errors.
     19 unclosed-modifier:
     20 	: $@-${UNCLOSED:
     21 
     22 # XXX: As of 2020-11-01, this command is executed even though it contains
     23 # parse errors.
     24 unknown-modifier:
     25 	: $@-${UNKNOWN:Z}-eol
     26 
     27 end:
     28 	: $@-eol
     29 
     30 # XXX: As of 2020-11-02, despite the parse errors, the exit status is 0.
     31