sh: Add some simplistic tests for the wait builtin.
This commit is contained in:
parent
dd85b12982
commit
f7b46e74b3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208476
23
tools/regression/bin/sh/builtins/wait1.0
Normal file
23
tools/regression/bin/sh/builtins/wait1.0
Normal file
@ -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"
|
15
tools/regression/bin/sh/builtins/wait2.0
Normal file
15
tools/regression/bin/sh/builtins/wait2.0
Normal file
@ -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"
|
Loading…
Reference in New Issue
Block a user