]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/shell-csh.mk
Update to bmake-20201101
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / shell-csh.mk
1 # $NetBSD: shell-csh.mk,v 1.5 2020/10/19 19:14:11 rillig Exp $
2 #
3 # Tests for using a C shell for running the commands.
4
5 CSH!=   which csh || true
6
7 # The shell path must be an absolute path.
8 # This is only obvious in parallel mode since in compat mode,
9 # simple commands are executed via execve directly.
10 .if ${CSH} != ""
11 .SHELL: name="csh" path="${CSH}"
12 .endif
13
14 # In parallel mode, the commandShell->noPrint command is filtered from
15 # the output, rather naively (in JobOutput).
16 #
17 # Until 2020-10-03, the output in parallel mode was garbled because
18 # the definition of the csh had been wrong since 1993 at least.
19 .MAKEFLAGS: -j1
20
21 all:
22 .if ${CSH} != ""
23         # This command is both printed and executed.
24         echo normal
25
26         # This command is only executed.
27         @echo hidden
28
29         # This command is both printed and executed.
30         +echo always
31
32         # This command is both printed and executed.
33         -echo ignore errors
34
35         # In the C shell, "unset verbose" is set as the noPrint command.
36         # Therefore it is filtered from the output, rather naively.
37         @echo 'They chatted in the sunset verbosely.'
38 .else
39         @sed '$$d' ${MAKEFILE:.mk=.exp} # This is cheated.
40 .endif