Home | History | Annotate | Line # | Download | only in unit-tests
varname-dot-curdir.mk revision 1.6
      1 # $NetBSD: varname-dot-curdir.mk,v 1.6 2020/10/05 19:27:48 rillig Exp $
      2 #
      3 # Tests for the special .CURDIR variable.
      4 
      5 # TODO: Implementation
      6 
      7 # Until 2020-10-04, assigning the result of a shell assignment to .CURDIR
      8 # tried to add the shell command ("echo /") to the .PATH instead of the
      9 # output of the shell command ("/").  Since "echo /" does not exist, the
     10 # .PATH was left unmodified.  See VarAssign_Eval.
     11 #
     12 # Since 2020-10-04, the output of the shell command is added to .PATH.
     13 .CURDIR!=	echo /
     14 .if ${.PATH:M/} != "/"
     15 .  error
     16 .endif
     17 
     18 # A normal assignment works fine, as does a substitution assignment.
     19 # Appending to .CURDIR does not make sense, therefore it doesn't matter that
     20 # this code path is buggy as well.
     21 .CURDIR=	/
     22 .if ${.PATH:M/} != "/"
     23 .  error
     24 .endif
     25 
     26 all:
     27 	@:;
     28