xref: /freebsd/contrib/bmake/unit-tests/varname-dot-make-pid.mk (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1# $NetBSD: varname-dot-make-pid.mk,v 1.3 2022/01/23 21:48:59 rillig Exp $
2#
3# Tests for the special .MAKE.PID variable, which contains the process ID of
4# the make process itself.
5
6# The process ID must be a positive integer.
7.if ${.MAKE.PID:C,[0-9],,g} != ""
8.  error
9.elif !(${.MAKE.PID} > 0)
10.  error
11.endif
12
13# Ensure that the process exists.
14_!=	kill -0 ${.MAKE.PID}
15
16all: .PHONY
17