xref: /openbsd/regress/lib/libc/sleep/Makefile (revision d2611de4)
1*d2611de4Sguenther#	$OpenBSD: Makefile,v 1.1 2009/12/14 05:08:19 guenther Exp $
2*d2611de4Sguenther
3*d2611de4SguentherNOMAN=
4*d2611de4SguentherPROG=sleep_test
5*d2611de4SguentherCPPFLAGS+=-I${.CURDIR}/../../../../lib/libc
6*d2611de4Sguenther
7*d2611de4Sguentherrun-regress-${PROG}: ${PROG}
8*d2611de4Sguenther	[ x$$(./${PROG} 1) = x0 ] || exit 1
9*d2611de4Sguenther	file=$$(mktemp -t sleep.XXXXXXXXXX); ./${PROG} 4 >$$file & pid=$$!; \
10*d2611de4Sguenther		sleep 1; kill $$pid; sleep 1; v=$$(cat $$file); rm -f $$file; \
11*d2611de4Sguenther		{ [ $$v -gt 0 ] && [ $$v -lt 4 ] ; } || exit 2
12*d2611de4Sguenther
13*d2611de4Sguenther.include <bsd.regress.mk>
14