"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "unit-tests/varmod-defined.mk" between
bmake-20201101.tar.gz and bmake-20201117.tar.gz

About: bmake a BSD make tool (derived from NetBSD’s make).

varmod-defined.mk  (bmake-20201101):varmod-defined.mk  (bmake-20201117)
# $NetBSD: varmod-defined.mk,v 1.7 2020/10/24 08:46:08 rillig Exp $ # $NetBSD: varmod-defined.mk,v 1.9 2020/11/12 00:40:55 rillig Exp $
# #
# Tests for the :D variable modifier, which returns the given string # Tests for the :D variable modifier, which returns the given string
# if the variable is defined. It is closely related to the :U modifier. # if the variable is defined. It is closely related to the :U modifier.
.MAKE.SAVE_DOLLARS= yes
DEF= defined DEF= defined
.undef UNDEF .undef UNDEF
# Since DEF is defined, the value of the expression is "value", not # Since DEF is defined, the value of the expression is "value", not
# "defined". # "defined".
# #
.if ${DEF:Dvalue} != "value" .if ${DEF:Dvalue} != "value"
. error . error
.endif .endif
skipping to change at line 88 skipping to change at line 90
# Since the variable with the empty name is never defined, the :D modifier # Since the variable with the empty name is never defined, the :D modifier
# can be used to add comments in the middle of an expression. That # can be used to add comments in the middle of an expression. That
# expression always evaluates to an empty string. # expression always evaluates to an empty string.
.if ${:D This is a comment. } != "" .if ${:D This is a comment. } != ""
. error . error
.endif .endif
# TODO: Add more tests for parsing the plain text part, to cover each branch # TODO: Add more tests for parsing the plain text part, to cover each branch
# of ApplyModifier_Defined. # of ApplyModifier_Defined.
# The :D and :U modifiers behave differently from the :@var@ modifier in
# that they preserve dollars in a ':=' assignment. This is because
# ApplyModifier_Defined passes the eflags unmodified to Var_Parse, unlike
# ApplyModifier_Loop, which uses ParseModifierPart, which in turn removes
# VARE_KEEP_DOLLAR from eflags.
#
# XXX: This inconsistency is documented nowhere.
.MAKEFLAGS: -dv
8_DOLLARS= $$$$$$$$
VAR:= ${8_DOLLARS}
VAR:= ${VAR:D${8_DOLLARS}}
VAR:= ${VAR:@var@${8_DOLLARS}@}
.MAKEFLAGS: -d0
all: all:
@:; @:;
 End of changes. 3 change blocks. 
1 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)