Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 May 2010 22:10:20 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208476 - head/tools/regression/bin/sh/builtins
Message-ID:  <201005232210.o4NMAK1v004716@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005232210.o4NMAK1v004716>