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 make(1): in test forloop.mk, replace...



details:   https://anonhg.NetBSD.org/src/rev/3a6921e89805
branches:  trunk
changeset: 945662:3a6921e89805
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Nov 03 17:37:57 2020 +0000

description:
make(1): in test forloop.mk, replace shell execution with .info

It's easier to read in the code, and the output has line information to
better relate the output to the code.

diffstat:

 usr.bin/make/unit-tests/forloop.exp |  28 ++++++++++++++--------------
 usr.bin/make/unit-tests/forloop.mk  |  16 ++++++++--------
 2 files changed, 22 insertions(+), 22 deletions(-)

diffs (92 lines):

diff -r c516ab39dc68 -r 3a6921e89805 usr.bin/make/unit-tests/forloop.exp
--- a/usr.bin/make/unit-tests/forloop.exp       Tue Nov 03 17:17:31 2020 +0000
+++ b/usr.bin/make/unit-tests/forloop.exp       Tue Nov 03 17:37:57 2020 +0000
@@ -1,17 +1,17 @@
-x=one
-x="two and three"
-x=four
-x="five"
-x=-I/this
-x=-I"This or that"
-x=-Ithat
-x="-DTHIS=\"this and that\""
-cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
-newline-item=(a)
-a=one b="two and three"
-a=four b="five"
-a=ONE b="TWO AND THREE"
-a=FOUR b="FIVE"
+make: "forloop.mk" line 14: x=one
+make: "forloop.mk" line 14: x="two and three"
+make: "forloop.mk" line 14: x=four
+make: "forloop.mk" line 14: x="five"
+make: "forloop.mk" line 20: x=-I/this
+make: "forloop.mk" line 20: x=-I"This or that"
+make: "forloop.mk" line 20: x=-Ithat
+make: "forloop.mk" line 20: x="-DTHIS=\"this and that\""
+make: "forloop.mk" line 27: cfl=-I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
+make: "forloop.mk" line 41: newline-item=(a)
+make: "forloop.mk" line 47: a=one b="two and three"
+make: "forloop.mk" line 47: a=four b="five"
+make: "forloop.mk" line 47: a=ONE b="TWO AND THREE"
+make: "forloop.mk" line 47: a=FOUR b="FIVE"
 We expect an error next:
 make: "forloop.mk" line 46: Wrong number of words (9) in .for substitution list with 2 variables
 make: Fatal errors encountered -- cannot continue
diff -r c516ab39dc68 -r 3a6921e89805 usr.bin/make/unit-tests/forloop.mk
--- a/usr.bin/make/unit-tests/forloop.mk        Tue Nov 03 17:17:31 2020 +0000
+++ b/usr.bin/make/unit-tests/forloop.mk        Tue Nov 03 17:37:57 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: forloop.mk,v 1.6 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: forloop.mk,v 1.7 2020/11/03 17:37:57 rillig Exp $
 
 all: for-loop
 
@@ -11,40 +11,40 @@
 .else
 
 .  for x in ${LIST}
-X!=    echo 'x=$x' >&2; echo
+.    info x=$x
 .  endfor
 
 CFL=   -I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
 cfl=
 .  for x in ${CFL}
-X!=    echo 'x=$x' >&2; echo
+.    info x=$x
 .    if empty(cfl)
 cfl=   $x
 .    else
 cfl+=  $x
 .    endif
 .  endfor
-X!=    echo 'cfl=${cfl}' >&2; echo
+.  info cfl=${cfl}
 
 .  if ${cfl} != ${CFL}
-.    error ${.newline}'${cfl}' != ${.newline}'${CFL}'
+.    error ${.newline}${cfl} != ${.newline}${CFL}
 .  endif
 
 .  for a b in ${EMPTY}
-X!=    echo 'a=$a b=$b' >&2; echo
+.    info a=$a b=$b
 .  endfor
 
 # Since at least 1993, iteration stops at the first newline.
 # Back then, the .newline variable didn't exist, therefore it was unlikely
 # that a newline ever occurred.
 .  for var in a${.newline}b${.newline}c
-X!=    echo 'newline-item=('${var:Q}')' 1>&2; echo
+.    info newline-item=(${var})
 .  endfor
 
 .endif # for-fail
 
 .for a b in ${LIST} ${LIST:tu} ${XTRA_LIST}
-X!=    echo 'a=$a b=$b' >&2; echo
+.  info a=$a b=$b
 .endfor
 
 for-loop:



Home | Main Index | Thread Index | Old Index