Date: Sun, 14 Jun 2009 16:21:51 +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: r194196 - in head/tools/regression/bin/sh: builtins execution Message-ID: <200906141621.n5EGLpMR054002@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906141621.n5EGLpMR054002>