Change @echo to echo in several places in escape.mk,

to make it easier to spot changes in what make sends to the shell.
Adjust escape.out to match.
This commit is contained in:
apb 2014-09-09 10:11:20 +00:00
parent 1bae62cc2f
commit 14a634bc53
2 changed files with 40 additions and 13 deletions

View File

@ -1,4 +1,5 @@
var-1bs
printf "%s=:%s:\n" VAR1BS 111\\111; printf "%s=:%s:\n" VAR1BSa 111\\aaa; printf "%s=:%s:\n" VAR1BSA 111\\aaa; printf "%s=:%s:\n" VAR1BSda 111\\\$\{a\}; printf "%s=:%s:\n" VAR1BSdA 111\\\$\{A\}; printf "%s=:%s:\n" VAR1BSc 111\#\ backslash\ escapes\ comment\ char,\ so\ this\ is\ part\ of\ the\ value; printf "%s=:%s:\n" VAR1BSsc 111\\\ ;
VAR1BS=:111\111:
VAR1BSa=:111\aaa:
VAR1BSA=:111\aaa:
@ -7,6 +8,7 @@ VAR1BSdA=:111\${A}:
VAR1BSc=:111# backslash escapes comment char, so this is part of the value:
VAR1BSsc=:111\ :
var-2bs
printf "%s=:%s:\n" VAR2BS 222\\\\222; printf "%s=:%s:\n" VAR2BSa 222\\\\aaa; printf "%s=:%s:\n" VAR2BSA 222\\\\aaa; printf "%s=:%s:\n" VAR2BSda 222\\\\\$\{a\}; printf "%s=:%s:\n" VAR2BSdA 222\\\\\$\{A\}; printf "%s=:%s:\n" VAR2BSc 222\\\\; printf "%s=:%s:\n" VAR2BSsc 222\\\\;
VAR2BS=:222\\222:
VAR2BSa=:222\\aaa:
VAR2BSA=:222\\aaa:
@ -15,6 +17,7 @@ VAR2BSdA=:222\\${A}:
VAR2BSc=:222\\:
VAR2BSsc=:222\\:
var-1bsnl
printf "%s=:%s:\n" VAR1BSNL 111\ 111; printf "%s=:%s:\n" VAR1BSNLa 111\ aaa; printf "%s=:%s:\n" VAR1BSNLA 111\ aaa; printf "%s=:%s:\n" VAR1BSNLda 111\ \$\{a\}; printf "%s=:%s:\n" VAR1BSNLdA 111\ \$\{A\}; printf "%s=:%s:\n" VAR1BSNLc 111; printf "%s=:%s:\n" VAR1BSNLsc 111;
VAR1BSNL=:111 111:
VAR1BSNLa=:111 aaa:
VAR1BSNLA=:111 aaa:
@ -23,6 +26,7 @@ VAR1BSNLdA=:111 ${A}:
VAR1BSNLc=:111:
VAR1BSNLsc=:111:
var-2bsnl
printf "%s=:%s:\n" VAR2BSNL 222\\\\; printf "%s=:%s:\n" VAR2BSNLa 222\\\\; printf "%s=:%s:\n" VAR2BSNLA 222\\\\; printf "%s=:%s:\n" VAR2BSNLda 222\\\\; printf "%s=:%s:\n" VAR2BSNLdA 222\\\\; printf "%s=:%s:\n" VAR2BSNLc 222\\\\; printf "%s=:%s:\n" VAR2BSNLsc 222\\\\;
VAR2BSNL=:222\\:
VAR2BSNLa=:222\\:
VAR2BSNLA=:222\\:
@ -31,6 +35,7 @@ VAR2BSNLdA=:222\\:
VAR2BSNLc=:222\\:
VAR2BSNLsc=:222\\:
var-3bsnl
printf "%s=:%s:\n" VAR3BSNL 333\\\\\ 333=; printf "%s=:%s:\n" VAR3BSNLa 333\\\\\ aaa=; printf "%s=:%s:\n" VAR3BSNLA 333\\\\\ aaa=; printf "%s=:%s:\n" VAR3BSNLda 333\\\\\ \$\{a\}=; printf "%s=:%s:\n" VAR3BSNLdA 333\\\\\ \$\{A\}=; printf "%s=:%s:\n" VAR3BSNLc 333\\\\; printf "%s=:%s:\n" VAR3BSNLsc 333\\\\;
VAR3BSNL=:333\\ 333=:
VAR3BSNLa=:333\\ aaa=:
VAR3BSNLA=:333\\ aaa=:
@ -39,6 +44,7 @@ VAR3BSNLdA=:333\\ ${A}=:
VAR3BSNLc=:333\\:
VAR3BSNLsc=:333\\:
var-1bsnl-space
printf "%s=:%s:\n" VAR1BSNL00 first\ line; printf "%s=:%s:\n" VAR1BSNL0 first\ line\ no\ space\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLs first\ line\ one\ space\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLss first\ line\ two\ spaces\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLt first\ line\ one\ tab\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLtt first\ line\ two\ tabs\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLxx first\ line\ many\ spaces\ and\ tabs\ \[\ \ \ \ \]\ on\ second\ line;
VAR1BSNL00=:first line:
VAR1BSNL0=:first line no space on second line:
VAR1BSNLs=:first line one space on second line:
@ -47,27 +53,48 @@ VAR1BSNLt=:first line one tab on second line:
VAR1BSNLtt=:first line two tabs on second line:
VAR1BSNLxx=:first line many spaces and tabs [ ] on second line:
cmd-1bsnl
echo :'first line\
#second line without space\
third line':
:first line\
#second line without space\
third line:
echo :'first line\
second line spaces should be retained':
:first line\
second line spaces should be retained:
echo :'first line\
second line tab should be elided':
:first line\
second line tab should be elided:
echo :'first line\
only one tab should be elided, second tab remains'
:first line\
only one tab should be elided, second tab remains
cmd-2bsnl
echo take one\\
take one\
echo take two\\
take two\
echo take three\\
take three\
cmd-3bsnl
echo :'first line\\\
#second line without space\\\
third line':
:first line\\\
#second line without space\\\
third line:
echo :'first line\\\
second line spaces should be retained':
:first line\\\
second line spaces should be retained:
echo :'first line\\\
second line tab should be elided':
:first line\\\
second line tab should be elided:
echo :'first line\\\
only one tab should be elided, second tab remains'
:first line\\\
only one tab should be elided, second tab remains
exit status 0

View File

@ -1,4 +1,4 @@
# $Id: escape.mk,v 1.8 2014/08/24 16:47:12 apb Exp $
# $Id: escape.mk,v 1.9 2014/09/09 10:11:20 apb Exp $
#
# Test backslash escaping.
@ -53,7 +53,7 @@ should continue the comment. \
__printvars: .USE .MADE
@echo ${.TARGET}
@${.ALLSRC:@v@ printf "%s=:%s:\n" ${v:Q} ${${v}:Q}; @}
${.ALLSRC:@v@ printf "%s=:%s:\n" ${v:Q} ${${v}:Q}; @}
# Embedded backslash in variable should be taken literally.
#
@ -194,14 +194,14 @@ var-1bsnl-space: .PHONY __printvars \
all: cmd-1bsnl
cmd-1bsnl: .PHONY
@echo ${.TARGET}
@echo :'first line\
echo :'first line\
#second line without space\
third line':
@echo :'first line\
echo :'first line\
second line spaces should be retained':
@echo :'first line\
echo :'first line\
second line tab should be elided':
@echo :'first line\
echo :'first line\
only one tab should be elided, second tab remains'
# Double-backslash-newline in a command.
@ -214,22 +214,22 @@ third line':
all: cmd-2bsnl
cmd-2bsnl: .PHONY
@echo ${.TARGET}
@echo take one\\
echo take one\\
# this should be a comment
@echo take two\\
@echo take three\\
echo take two\\
echo take three\\
# Triple-backslash-newline in a command is retained.
#
all: cmd-3bsnl
cmd-3bsnl: .PHONY
@echo ${.TARGET}
@echo :'first line\\\
echo :'first line\\\
#second line without space\\\
third line':
@echo :'first line\\\
echo :'first line\\\
second line spaces should be retained':
@echo :'first line\\\
echo :'first line\\\
second line tab should be elided':
@echo :'first line\\\
echo :'first line\\\
only one tab should be elided, second tab remains'