From owner-svn-src-all@FreeBSD.ORG Sun Jun 14 16:21:52 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3367B1065672; Sun, 14 Jun 2009 16:21:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20AD38FC15; Sun, 14 Jun 2009 16:21:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5EGLpBw054004; Sun, 14 Jun 2009 16:21:51 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5EGLpMR054002; Sun, 14 Jun 2009 16:21:51 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200906141621.n5EGLpMR054002@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 14 Jun 2009 16:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194196 - in head/tools/regression/bin/sh: builtins execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2009 16:21:52 -0000 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