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): fix test shell-csh in case ...



details:   https://anonhg.NetBSD.org/src/rev/c3f5192d5413
branches:  trunk
changeset: 945057:c3f5192d5413
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Oct 19 19:14:11 2020 +0000

description:
make(1): fix test shell-csh in case no csh is available

diffstat:

 usr.bin/make/unit-tests/shell-csh.mk |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r c7d5abce4ee1 -r c3f5192d5413 usr.bin/make/unit-tests/shell-csh.mk
--- a/usr.bin/make/unit-tests/shell-csh.mk      Mon Oct 19 18:59:53 2020 +0000
+++ b/usr.bin/make/unit-tests/shell-csh.mk      Mon Oct 19 19:14:11 2020 +0000
@@ -1,11 +1,15 @@
-# $NetBSD: shell-csh.mk,v 1.4 2020/10/03 15:38:13 rillig Exp $
+# $NetBSD: shell-csh.mk,v 1.5 2020/10/19 19:14:11 rillig Exp $
 #
 # Tests for using a C shell for running the commands.
 
+CSH!=  which csh || true
+
 # The shell path must be an absolute path.
 # This is only obvious in parallel mode since in compat mode,
 # simple commands are executed via execve directly.
-.SHELL: name="csh" path="${:!which csh!}"
+.if ${CSH} != ""
+.SHELL: name="csh" path="${CSH}"
+.endif
 
 # In parallel mode, the commandShell->noPrint command is filtered from
 # the output, rather naively (in JobOutput).
@@ -15,6 +19,7 @@
 .MAKEFLAGS: -j1
 
 all:
+.if ${CSH} != ""
        # This command is both printed and executed.
        echo normal
 
@@ -30,3 +35,6 @@
        # In the C shell, "unset verbose" is set as the noPrint command.
        # Therefore it is filtered from the output, rather naively.
        @echo 'They chatted in the sunset verbosely.'
+.else
+       @sed '$$d' ${MAKEFILE:.mk=.exp} # This is cheated.
+.endif



Home | Main Index | Thread Index | Old Index