aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/sh-errctl.mk
blob: ecc2485e9b721fe73632a231df1ecb129b5c6646 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# $NetBSD: sh-errctl.mk,v 1.1 2020/12/12 15:06:11 rillig Exp $
#
# Test a shell with error control.  This only works in jobs mode; in compat
# mode, the default shell is always used, see InitShellNameAndPath.
#
# There is a subtle difference between error control and echo control.
# With error control, each simple command is checked, whereas with echo
# control, only the last command from each line is checked.  A shell command
# line that behaves differently in these two modes is "false; true".  In
# error control mode, this fails, while in echo control mode, it succeeds.

.MAKEFLAGS: -j1 -dj

.SHELL: \
	name="sh" \
	path="${.SHELL}" \
	hasErrCtl="yes" \
	check="\# error checking on\nset -e" \
	ignore="\# error checking off\nset +e" \
	echo="\# echo on" \
	quiet="\# echo off"

all:
	@echo silent
	-echo ignerr; false
	+echo always