svn commit: r208476 - head/tools/regression/bin/sh/builtins

Jilles Tjoelker jilles at FreeBSD.org
Sun May 23 22:10:20 UTC 2010


Author: jilles
Date: Sun May 23 22:10:20 2010
New Revision: 208476
URL: http://svn.freebsd.org/changeset/base/208476

Log:
  sh: Add some simplistic tests for the wait builtin.

Added:
  head/tools/regression/bin/sh/builtins/wait1.0   (contents, props changed)
  head/tools/regression/bin/sh/builtins/wait2.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/wait1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/wait1.0	Sun May 23 22:10:20 2010	(r208476)
@@ -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"

Added: head/tools/regression/bin/sh/builtins/wait2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/wait2.0	Sun May 23 22:10:20 2010	(r208476)
@@ -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"


More information about the svn-src-head mailing list