Wed Feb 9 21:24:29 2022 UTC ()
tests/make: remove redundant 'echo' from variable assignments

Before main.c 1.231 from 2014-09-09, a variable assignment using the
operator '!=' generated a warning "Couldn't read shell's output" if the
output of the command was empty.  The simplest way to suppress this
wrong warning was to add an empty 'echo' to the command.  This hack is
no longer needed.


(rillig)
diff -r1.306 -r1.307 src/usr.bin/make/unit-tests/Makefile
diff -r1.6 -r1.7 src/usr.bin/make/unit-tests/objdir-writable.mk

cvs diff -r1.306 -r1.307 src/usr.bin/make/unit-tests/Makefile (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/Makefile 2022/02/09 21:09:24 1.306
+++ src/usr.bin/make/unit-tests/Makefile 2022/02/09 21:24:29 1.307
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.306 2022/02/09 21:09:24 rillig Exp $ 1# $NetBSD: Makefile,v 1.307 2022/02/09 21:24:29 rillig Exp $
2# 2#
3# Unit tests for make(1) 3# Unit tests for make(1)
4# 4#
5# The main targets are: 5# The main targets are:
6# 6#
7# all: 7# all:
8# run all the tests 8# run all the tests
9# test: 9# test:
10# run 'all', and compare to expected results 10# run 'all', and compare to expected results
11# accept: 11# accept:
12# move generated output to expected results 12# move generated output to expected results
13# 13#
14# Settable variables 14# Settable variables
@@ -643,27 +643,27 @@ LANG= C @@ -643,27 +643,27 @@ LANG= C
643 643
644# for many tests we need a TMPDIR that will not collide 644# for many tests we need a TMPDIR that will not collide
645# with other users. 645# with other users.
646.if ${.OBJDIR} != ${.CURDIR} 646.if ${.OBJDIR} != ${.CURDIR}
647# easy 647# easy
648TMPDIR:= ${.OBJDIR}/tmp 648TMPDIR:= ${.OBJDIR}/tmp
649.elif defined(TMPDIR) 649.elif defined(TMPDIR)
650TMPDIR:= ${TMPDIR}/uid${.MAKE.UID} 650TMPDIR:= ${TMPDIR}/uid${.MAKE.UID}
651.else 651.else
652TMPDIR:= /tmp/uid${.MAKE.UID} 652TMPDIR:= /tmp/uid${.MAKE.UID}
653.endif 653.endif
654# make sure it exists 654# make sure it exists
655.if !exist(${TMPDIR}) 655.if !exist(${TMPDIR})
656x!= echo; mkdir -p ${TMPDIR} 656_!= mkdir -p ${TMPDIR}
657.endif 657.endif
658 658
659MAKE_TEST_ENV= MALLOC_OPTIONS="JA" # for jemalloc 100 659MAKE_TEST_ENV= MALLOC_OPTIONS="JA" # for jemalloc 100
660MAKE_TEST_ENV+= MALLOC_CONF="junk:true" # for jemalloc 510 660MAKE_TEST_ENV+= MALLOC_CONF="junk:true" # for jemalloc 510
661MAKE_TEST_ENV+= TMPDIR=${TMPDIR} 661MAKE_TEST_ENV+= TMPDIR=${TMPDIR}
662 662
663.if ${.MAKE.OS} == "NetBSD" 663.if ${.MAKE.OS} == "NetBSD"
664LIMIT_RESOURCES?= ulimit -v 200000 664LIMIT_RESOURCES?= ulimit -v 200000
665.endif 665.endif
666LIMIT_RESOURCES?= : 666LIMIT_RESOURCES?= :
667 667
668# Each test is run in a sub-make, to keep the tests from interfering with 668# Each test is run in a sub-make, to keep the tests from interfering with
669# each other, and because they use different environment variables and 669# each other, and because they use different environment variables and

cvs diff -r1.6 -r1.7 src/usr.bin/make/unit-tests/objdir-writable.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/objdir-writable.mk 2022/02/09 21:09:24 1.6
+++ src/usr.bin/make/unit-tests/objdir-writable.mk 2022/02/09 21:24:29 1.7
@@ -1,30 +1,31 @@ @@ -1,30 +1,31 @@
1# $NetBSD: objdir-writable.mk,v 1.6 2022/02/09 21:09:24 rillig Exp $ 1# $NetBSD: objdir-writable.mk,v 1.7 2022/02/09 21:24:29 rillig Exp $
2 2
3# test checking for writable objdir 3# test checking for writable objdir
4 4
5TMPDIR?= /tmp 5TMPDIR?= /tmp
6RO_OBJDIR?= ${TMPDIR}/roobj 6RO_OBJDIR?= ${TMPDIR}/roobj
7 7
8.if make(do-objdir) 8.if make(do-objdir)
9# this should succeed 9# this should succeed
10.OBJDIR: ${RO_OBJDIR} 10.OBJDIR: ${RO_OBJDIR}
11 11
12do-objdir: 12do-objdir:
13.else 13.else
14all: no-objdir ro-objdir explicit-objdir 14all: no-objdir ro-objdir explicit-objdir
15 15
16# make it now 16# make it now
17x!= echo; mkdir -p ${RO_OBJDIR}; chmod 555 ${RO_OBJDIR} 17_!= mkdir -p ${RO_OBJDIR}
 18_!= chmod 555 ${RO_OBJDIR}
18 19
19.END: rm-objdir 20.END: rm-objdir
20rm-objdir: 21rm-objdir:
21 @rmdir ${RO_OBJDIR} 22 @rmdir ${RO_OBJDIR}
22 23
23no-objdir: 24no-objdir:
24 @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C ${TMPDIR} -V .OBJDIR 25 @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C ${TMPDIR} -V .OBJDIR
25 26
26ro-objdir: 27ro-objdir:
27 @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C ${TMPDIR} -V .OBJDIR MAKE_OBJDIR_CHECK_WRITABLE=no 28 @MAKEOBJDIR=${RO_OBJDIR} ${.MAKE} -r -f /dev/null -C ${TMPDIR} -V .OBJDIR MAKE_OBJDIR_CHECK_WRITABLE=no
28 29
29explicit-objdir: 30explicit-objdir:
30 @MAKEOBJDIR=${TMPDIR} ${.MAKE} -r -f ${MAKEFILE:tA} -C ${TMPDIR} do-objdir -V .OBJDIR 31 @MAKEOBJDIR=${TMPDIR} ${.MAKE} -r -f ${MAKEFILE:tA} -C ${TMPDIR} do-objdir -V .OBJDIR