xref: /freebsd/contrib/bmake/unit-tests/sh-errctl.mk (revision d485c77f203fb0f4cdc08dea5ff81631b51d8809)
1# $NetBSD: sh-errctl.mk,v 1.1 2020/12/12 15:06:11 rillig Exp $
2#
3# Test a shell with error control.  This only works in jobs mode; in compat
4# mode, the default shell is always used, see InitShellNameAndPath.
5#
6# There is a subtle difference between error control and echo control.
7# With error control, each simple command is checked, whereas with echo
8# control, only the last command from each line is checked.  A shell command
9# line that behaves differently in these two modes is "false; true".  In
10# error control mode, this fails, while in echo control mode, it succeeds.
11
12.MAKEFLAGS: -j1 -dj
13
14.SHELL: \
15	name="sh" \
16	path="${.SHELL}" \
17	hasErrCtl="yes" \
18	check="\# error checking on\nset -e" \
19	ignore="\# error checking off\nset +e" \
20	echo="\# echo on" \
21	quiet="\# echo off"
22
23all:
24	@echo silent
25	-echo ignerr; false
26	+echo always
27