From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:43:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0A833FA; Wed, 3 Jul 2013 21:43:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A224A1A27; Wed, 3 Jul 2013 21:43:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Lhi5E028190; Wed, 3 Jul 2013 21:43:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LhgTQ028171; Wed, 3 Jul 2013 21:43:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032143.r63LhgTQ028171@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252613 - in stable/9/tools/regression/bin/sh: builtins execution expansion X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jul 2013 21:43:44 -0000 Author: jilles Date: Wed Jul 3 21:43:41 2013 New Revision: 252613 URL: http://svnweb.freebsd.org/changeset/base/252613 Log: MFC r245383,245392,247190,249220,251180,251797: New sh testcases. These already work on stable/9. Added: stable/9/tools/regression/bin/sh/builtins/break4.4 - copied unchanged from r251180, head/tools/regression/bin/sh/builtins/break4.4 stable/9/tools/regression/bin/sh/builtins/break5.4 - copied unchanged from r251180, head/tools/regression/bin/sh/builtins/break5.4 stable/9/tools/regression/bin/sh/builtins/eval6.0 - copied unchanged from r249220, head/tools/regression/bin/sh/builtins/eval6.0 stable/9/tools/regression/bin/sh/builtins/local2.0 - copied unchanged from r251797, head/tools/regression/bin/sh/builtins/local2.0 stable/9/tools/regression/bin/sh/builtins/local3.0 - copied unchanged from r251797, head/tools/regression/bin/sh/builtins/local3.0 stable/9/tools/regression/bin/sh/builtins/read6.0 - copied unchanged from r247190, head/tools/regression/bin/sh/builtins/read6.0 stable/9/tools/regression/bin/sh/execution/subshell1.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell1.0 stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout stable/9/tools/regression/bin/sh/execution/subshell2.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell2.0 stable/9/tools/regression/bin/sh/execution/subshell3.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell3.0 stable/9/tools/regression/bin/sh/execution/subshell4.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell4.0 stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 - copied unchanged from r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0 Modified: Directory Properties: stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/break4.4 (from r251180, head/tools/regression/bin/sh/builtins/break4.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/break4.4 Wed Jul 3 21:43:41 2013 (r252613, copy of r251180, head/tools/regression/bin/sh/builtins/break4.4) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. + +break +exit 4 Copied: stable/9/tools/regression/bin/sh/builtins/break5.4 (from r251180, head/tools/regression/bin/sh/builtins/break5.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/break5.4 Wed Jul 3 21:43:41 2013 (r252613, copy of r251180, head/tools/regression/bin/sh/builtins/break5.4) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. +# In some uncommitted code, the subshell environment corrupted the outer +# shell environment's state. + +(for i in a b c; do + exit 3 +done) +break +exit 4 Copied: stable/9/tools/regression/bin/sh/builtins/eval6.0 (from r249220, head/tools/regression/bin/sh/builtins/eval6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/eval6.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r249220, head/tools/regression/bin/sh/builtins/eval6.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# eval should preserve $? from command substitutions when starting +# the parsed command. +[ $(false; eval 'echo $?' $(:)) = 0 ] Copied: stable/9/tools/regression/bin/sh/builtins/local2.0 (from r251797, head/tools/regression/bin/sh/builtins/local2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/local2.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r251797, head/tools/regression/bin/sh/builtins/local2.0) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +f() { + local - + set -a + case $- in + *a*) : ;; + *) echo In-function \$- bad + esac +} +case $- in +*a*) echo Initial \$- bad +esac +f +case $- in +*a*) echo Final \$- bad +esac Copied: stable/9/tools/regression/bin/sh/builtins/local3.0 (from r251797, head/tools/regression/bin/sh/builtins/local3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/local3.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r251797, head/tools/regression/bin/sh/builtins/local3.0) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +f() { + local "$@" + set -a + x=7 + case $- in + *a*) : ;; + *) echo In-function \$- bad + esac + [ "$x" = 7 ] || echo In-function \$x bad +} +x=1 +case $- in +*a*) echo Initial \$- bad +esac +f x - +case $- in +*a*) echo Intermediate \$- bad +esac +[ "$x" = 1 ] || echo Intermediate \$x bad +f - x +case $- in +*a*) echo Final \$- bad +esac +[ "$x" = 1 ] || echo Final \$x bad Copied: stable/9/tools/regression/bin/sh/builtins/read6.0 (from r247190, head/tools/regression/bin/sh/builtins/read6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/read6.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r247190, head/tools/regression/bin/sh/builtins/read6.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +: | read x +r=$? +[ "$r" = 1 ] Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0 (from r245383, head/tools/regression/bin/sh/execution/subshell1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell1.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell1.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +(eval "cd / +v=$(printf %0100000d 1) +echo \${#v}") +echo end Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout (from r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout) @@ -0,0 +1,2 @@ +100000 +end Copied: stable/9/tools/regression/bin/sh/execution/subshell2.0 (from r245383, head/tools/regression/bin/sh/execution/subshell2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell2.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell2.0) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + x=2 +} +( + x=1 + f + [ "$x" = 2 ] +) Copied: stable/9/tools/regression/bin/sh/execution/subshell3.0 (from r245383, head/tools/regression/bin/sh/execution/subshell3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell3.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell3.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +(false; exit) && exit 3 +exit 0 Copied: stable/9/tools/regression/bin/sh/execution/subshell4.0 (from r245383, head/tools/regression/bin/sh/execution/subshell4.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell4.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell4.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +(eval "set v=1"; false) && echo bad; : Copied: stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 (from r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 3; } +f +[ `echo $?` = 3 ]