Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests Change @echo to echo in several plac...
details: https://anonhg.NetBSD.org/src/rev/460fbeecfb31
branches: trunk
changeset: 332159:460fbeecfb31
user: apb <apb%NetBSD.org@localhost>
date: Tue Sep 09 10:11:20 2014 +0000
description:
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.
diffstat:
usr.bin/make/unit-tests/escape.exp | 27 +++++++++++++++++++++++++++
usr.bin/make/unit-tests/escape.mk | 26 +++++++++++++-------------
2 files changed, 40 insertions(+), 13 deletions(-)
diffs (165 lines):
diff -r 7eecf4ce747c -r 460fbeecfb31 usr.bin/make/unit-tests/escape.exp
--- a/usr.bin/make/unit-tests/escape.exp Tue Sep 09 10:06:47 2014 +0000
+++ b/usr.bin/make/unit-tests/escape.exp Tue Sep 09 10:11:20 2014 +0000
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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
diff -r 7eecf4ce747c -r 460fbeecfb31 usr.bin/make/unit-tests/escape.mk
--- a/usr.bin/make/unit-tests/escape.mk Tue Sep 09 10:06:47 2014 +0000
+++ b/usr.bin/make/unit-tests/escape.mk Tue Sep 09 10:11:20 2014 +0000
@@ -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 @@
__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 @@
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 @@
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'
Home |
Main Index |
Thread Index |
Old Index