diff options
author | guenther <> | 2009-12-14 05:08:19 +0000 |
---|---|---|
committer | guenther <> | 2009-12-14 05:08:19 +0000 |
commit | e0fd73fcca39e03d57dc0a553e943e84cda61e30 (patch) | |
tree | f1c6a7b3c524ee3e67f8bbfd4ca9c741ed1915af /src/regress/lib/libc/sleep/Makefile | |
parent | 3db0519782031aa1e2d42b99ad04bd5a00ec126d (diff) | |
download | openbsd-e0fd73fcca39e03d57dc0a553e943e84cda61e30.tar.gz openbsd-e0fd73fcca39e03d57dc0a553e943e84cda61e30.tar.bz2 openbsd-e0fd73fcca39e03d57dc0a553e943e84cda61e30.zip |
Add a test for sleep(3), to verify that it both (a) returns zero when it
completes, and (b) returns the unslept time in seconds when interrupted
Diffstat (limited to 'src/regress/lib/libc/sleep/Makefile')
-rw-r--r-- | src/regress/lib/libc/sleep/Makefile | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/regress/lib/libc/sleep/Makefile b/src/regress/lib/libc/sleep/Makefile new file mode 100644 index 0000000000..3700b1662a --- /dev/null +++ b/src/regress/lib/libc/sleep/Makefile | |||
@@ -0,0 +1,13 @@ | |||
1 | # $OpenBSD: Makefile,v 1.1 2009/12/14 05:08:19 guenther Exp $ | ||
2 | |||
3 | NOMAN= | ||
4 | PROG=sleep_test | ||
5 | CPPFLAGS+=-I${.CURDIR}/../../../../lib/libc | ||
6 | |||
7 | run-regress-${PROG}: ${PROG} | ||
8 | [ x$$(./${PROG} 1) = x0 ] || exit 1 | ||
9 | file=$$(mktemp -t sleep.XXXXXXXXXX); ./${PROG} 4 >$$file & pid=$$!; \ | ||
10 | sleep 1; kill $$pid; sleep 1; v=$$(cat $$file); rm -f $$file; \ | ||
11 | { [ $$v -gt 0 ] && [ $$v -lt 4 ] ; } || exit 2 | ||
12 | |||
13 | .include <bsd.regress.mk> | ||