svn commit: r194196 - in head/tools/regression/bin/sh: builtins execution

Jilles Tjoelker jilles at FreeBSD.org
Sun Jun 14 16:21:52 UTC 2009


Author: jilles
Date: Sun Jun 14 16:21:51 2009
New Revision: 194196
URL: http://svn.freebsd.org/changeset/base/194196

Log:
  Add tests for r194127 and r194128.
  
  Approved by:	ed (mentor)

Added:
  head/tools/regression/bin/sh/builtins/trap1.0   (contents, props changed)
  head/tools/regression/bin/sh/execution/
  head/tools/regression/bin/sh/execution/fork1.0   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/trap1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/trap1.0	Sun Jun 14 16:21:51 2009	(r194196)
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+test "$(trap 'echo trapped' EXIT; :)" = trapped || exit 1
+
+test "$(trap 'echo trapped' EXIT; /usr/bin/true)" = trapped || exit 1
+
+result=$(sh -c 'trap "echo trapped" EXIT; /usr/bin/false')
+test $? -eq 1 || exit 1
+test "$result" = trapped || exit 1
+
+result=$(sh -c 'trap "echo trapped" EXIT; exec /usr/bin/false')
+test $? -eq 1 || exit 1
+test -z "$result" || exit 1
+
+result=0
+trap 'result=$((result+1))' INT
+kill -INT $$
+test "$result" -eq 1 || exit 1
+(kill -INT $$)
+test "$result" -eq 2 || exit 1
+
+exit 0

Added: head/tools/regression/bin/sh/execution/fork1.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/execution/fork1.0	Sun Jun 14 16:21:51 2009	(r194196)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+result=$(sh -c 'ps -p $$ -o comm=')
+test "$result" = "ps" || exit 1
+
+result=$(sh -c 'ps -p $$ -o comm=; :')
+test "$result" = "sh" || exit 1


More information about the svn-src-head mailing list