xref: /freebsd/contrib/bmake/unit-tests/varmod-sun-shell.mk (revision 6a7405f5a6b639682cacf01e35d561411ff556aa)
1# $NetBSD: varmod-sun-shell.mk,v 1.6 2024/08/29 20:20:37 rillig Exp $
2#
3# Tests for the :sh variable modifier, which runs the shell command
4# given by the variable value and returns its output.
5#
6# This modifier has been added on 1996-05-29.
7#
8# See also:
9#	ApplyModifier_SunShell
10
11.if ${echo word:L:sh} != "word"
12.  error
13.endif
14
15# If the command exits with non-zero, a warning is printed.
16# expect+1: warning: Command "echo word; (exit 13)" exited with status 13
17.if ${echo word; (exit 13):L:sh} != "word"
18.  error
19.endif
20
21
22.MAKEFLAGS: -dv			# to see the "Capturing" debug output
23# expect+1: warning: Command "echo word; (exit 13)" exited with status 13
24_:=	${echo word; ${:U(exit 13)}:L:sh}
25.MAKEFLAGS: -d0
26
27
28all:
29