diff options
author | jilles <jilles@FreeBSD.org> | 2010-11-19 21:15:06 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2010-11-19 21:15:06 +0000 |
commit | 30e82871824e76964d848069429fe0b075834b18 (patch) | |
tree | 59d62072a592a1c8e2b12b477002540bc7275bb9 | |
parent | 4902b4f43a670eb338c672582e233d12c19937c9 (diff) | |
download | FreeBSD-src-30e82871824e76964d848069429fe0b075834b18.zip FreeBSD-src-30e82871824e76964d848069429fe0b075834b18.tar.gz |
sh: Add another simple test for the wait builtin.
-rw-r--r-- | tools/regression/bin/sh/builtins/wait3.0 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/wait3.0 b/tools/regression/bin/sh/builtins/wait3.0 new file mode 100644 index 0000000..d4eb250 --- /dev/null +++ b/tools/regression/bin/sh/builtins/wait3.0 @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf $T' 0 +cd $T || exit 3 +mkfifo fifo1 +for i in 1 2 3 4 5 6 7 8 9 10; do + exit $i 4<fifo1 & +done +exec 3>fifo1 +wait || failure $LINENO +(echo >&3) 2>/dev/null && failure $LINENO +wait || failure $LINENO + +test -z "$failures" |