diff options
author | jilles <jilles@FreeBSD.org> | 2010-05-23 22:10:20 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2010-05-23 22:10:20 +0000 |
commit | add6413e9ac3e0d554b2f8bea1e13e04a5401f56 (patch) | |
tree | 35cf63f0a1fb70983aee427ea1648ce8cba9b9cc /tools | |
parent | 5e6f9e5ca8f945626fa078c84856305b0112990c (diff) | |
download | FreeBSD-src-add6413e9ac3e0d554b2f8bea1e13e04a5401f56.zip FreeBSD-src-add6413e9ac3e0d554b2f8bea1e13e04a5401f56.tar.gz |
sh: Add some simplistic tests for the wait builtin.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/bin/sh/builtins/wait1.0 | 23 | ||||
-rw-r--r-- | tools/regression/bin/sh/builtins/wait2.0 | 15 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/wait1.0 b/tools/regression/bin/sh/builtins/wait1.0 new file mode 100644 index 0000000..1ca8530 --- /dev/null +++ b/tools/regression/bin/sh/builtins/wait1.0 @@ -0,0 +1,23 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +exit 4 & p4=$! +exit 8 & p8=$! +wait $p4 +[ $? = 4 ] || failure $LINENO +wait $p8 +[ $? = 8 ] || failure $LINENO + +exit 3 & p3=$! +exit 7 & p7=$! +wait $p7 +[ $? = 7 ] || failure $LINENO +wait $p3 +[ $? = 3 ] || failure $LINENO + +test -z "$failures" diff --git a/tools/regression/bin/sh/builtins/wait2.0 b/tools/regression/bin/sh/builtins/wait2.0 new file mode 100644 index 0000000..e61455c --- /dev/null +++ b/tools/regression/bin/sh/builtins/wait2.0 @@ -0,0 +1,15 @@ +# $FreeBSD$ + +failures= +failure() { + echo "Error at line $1" >&2 + failures=x$failures +} + +for i in 1 2 3 4 5 6 7 8 9 10; do + exit $i & +done +wait || failure $LINENO +wait || failure $LINENO + +test -z "$failures" |