1# $NetBSD: varmod-sun-shell1.mk,v 1.1 2025/11/12 22:14:08 sjg Exp $
2#
3# Tests for the :sh1 variable modifier, which runs the shell command
4# given by the variable value only on first reference and caches its output.
5#
6# This modifier has been added on 2025-11-11
7#
8# See also:
9#	ApplyModifier_SunShell1
10
11ANSWER= echo 42; (exit 13)
12THE_ANSWER= ${ANSWER:sh1}
13
14# first reference will warn
15.MAKEFLAGS: -dv			# to see the "Capturing" debug output
16# expect+1: warning: Command "echo 42; (exit 13)" exited with status 13
17_:=	${THE_ANSWER}
18.MAKEFLAGS: -d0
19
20# subsequent references will not, since we do not execute a command
21.if ${THE_ANSWER} != "42"
22.  error
23.endif
24
25all:
26