Module Name:    src
Committed By:   rillig
Date:           Tue Nov  3 17:37:57 UTC 2020

Modified Files:
        src/usr.bin/make/unit-tests: forloop.exp forloop.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/forloop.exp
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/forloop.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/forloop.exp
diff -u src/usr.bin/make/unit-tests/forloop.exp:1.3 src/usr.bin/make/unit-tests/forloop.exp:1.4
--- src/usr.bin/make/unit-tests/forloop.exp:1.3	Sun Oct 25 16:15:48 2020
+++ src/usr.bin/make/unit-tests/forloop.exp	Tue Nov  3 17:37:57 2020
@@ -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

Index: src/usr.bin/make/unit-tests/forloop.mk
diff -u src/usr.bin/make/unit-tests/forloop.mk:1.6 src/usr.bin/make/unit-tests/forloop.mk:1.7
--- src/usr.bin/make/unit-tests/forloop.mk:1.6	Sat Oct 24 08:50:17 2020
+++ src/usr.bin/make/unit-tests/forloop.mk	Tue Nov  3 17:37:57 2020
@@ -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 @@ XTRA_LIST=	xtra
 .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:

Reply via email to