From owner-svn-src-all@FreeBSD.ORG Mon Oct 18 23:10:32 2010 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 8C406106564A; Mon, 18 Oct 2010 23:10:32 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 773118FC20; Mon, 18 Oct 2010 23:10:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9INAWSR089631; Mon, 18 Oct 2010 23:10:32 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9INAWPU089616; Mon, 18 Oct 2010 23:10:32 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010182310.o9INAWPU089616@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 18 Oct 2010 23:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214045 - in stable/8/tools/regression/bin/sh: builtins errors execution expansion set-e 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: Mon, 18 Oct 2010 23:10:32 -0000 Author: obrien Date: Mon Oct 18 23:10:32 2010 New Revision: 214045 URL: http://svn.freebsd.org/changeset/base/214045 Log: MFC: r199955: disable job control when running 'sh -i' in the testsuite r204801: make sure to popredir() even if a special builtin caused an error r204802: make sure to popredir() even if a function caused an error r211399: get rid of unnecessary non-standard empty lists. r211609: add a test for breaking from a loop outside the current function r211622: test that all bytes from 128 to 255 can be used in IFS r211973: weaken builtins/command4 test to only require a non-0 exit status Added: stable/8/tools/regression/bin/sh/builtins/break3.0 - copied unchanged from r211609, head/tools/regression/bin/sh/builtins/break3.0 stable/8/tools/regression/bin/sh/builtins/command10.0 - copied unchanged from r204802, head/tools/regression/bin/sh/builtins/command10.0 stable/8/tools/regression/bin/sh/builtins/command4.0 - copied unchanged from r211973, head/tools/regression/bin/sh/builtins/command4.0 stable/8/tools/regression/bin/sh/builtins/command9.0 - copied unchanged from r204801, head/tools/regression/bin/sh/builtins/command9.0 stable/8/tools/regression/bin/sh/expansion/ifs3.0 - copied unchanged from r211622, head/tools/regression/bin/sh/expansion/ifs3.0 Deleted: stable/8/tools/regression/bin/sh/builtins/command4.127 Modified: stable/8/tools/regression/bin/sh/builtins/command3.0 stable/8/tools/regression/bin/sh/builtins/command5.0 stable/8/tools/regression/bin/sh/errors/backquote-error1.0 stable/8/tools/regression/bin/sh/execution/func2.0 stable/8/tools/regression/bin/sh/set-e/elif1.0 stable/8/tools/regression/bin/sh/set-e/elif2.0 stable/8/tools/regression/bin/sh/set-e/if1.0 stable/8/tools/regression/bin/sh/set-e/if3.0 stable/8/tools/regression/bin/sh/set-e/while1.0 stable/8/tools/regression/bin/sh/set-e/while2.0 Directory Properties: stable/8/tools/regression/bin/sh/ (props changed) Copied: stable/8/tools/regression/bin/sh/builtins/break3.0 (from r211609, head/tools/regression/bin/sh/builtins/break3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/break3.0 Mon Oct 18 23:10:32 2010 (r214045, copy of r211609, head/tools/regression/bin/sh/builtins/break3.0) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +# We accept this and people might rely on it. +# However, various other shells do not accept it. + +f() { + break + echo bad1 +} + +while :; do + f + echo bad2 + exit 2 +done Copied: stable/8/tools/regression/bin/sh/builtins/command10.0 (from r204802, head/tools/regression/bin/sh/builtins/command10.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/command10.0 Mon Oct 18 23:10:32 2010 (r214045, copy of r204802, head/tools/regression/bin/sh/builtins/command10.0) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +check '"$(f() { shift x; }; { command eval f 2>/dev/null; } >/dev/null; echo hi)" = hi' + +exit $((failures > 0)) Modified: stable/8/tools/regression/bin/sh/builtins/command3.0 ============================================================================== --- stable/8/tools/regression/bin/sh/builtins/command3.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/builtins/command3.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -4,6 +4,7 @@ command -v true command -v /bin/ls fun() { + : } command -v fun command -v break Copied: stable/8/tools/regression/bin/sh/builtins/command4.0 (from r211973, head/tools/regression/bin/sh/builtins/command4.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/command4.0 Mon Oct 18 23:10:32 2010 (r214045, copy of r211973, head/tools/regression/bin/sh/builtins/command4.0) @@ -0,0 +1,2 @@ +# $FreeBSD$ +! command -v nonexisting Modified: stable/8/tools/regression/bin/sh/builtins/command5.0 ============================================================================== --- stable/8/tools/regression/bin/sh/builtins/command5.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/builtins/command5.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -4,6 +4,7 @@ command -V true command -V /bin/ls fun() { + : } command -V fun command -V break Copied: stable/8/tools/regression/bin/sh/builtins/command9.0 (from r204801, head/tools/regression/bin/sh/builtins/command9.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/builtins/command9.0 Mon Oct 18 23:10:32 2010 (r214045, copy of r204801, head/tools/regression/bin/sh/builtins/command9.0) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +check '"$({ command eval shift x 2>/dev/null; } >/dev/null; echo hi)" = hi' + +exit $((failures > 0)) Modified: stable/8/tools/regression/bin/sh/errors/backquote-error1.0 ============================================================================== --- stable/8/tools/regression/bin/sh/errors/backquote-error1.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/errors/backquote-error1.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,4 +1,4 @@ # $FreeBSD$ -echo 'echo `for` echo ".BAD"CODE.' | sh -i 2>&1 | grep -q BADCODE && exit 1 +echo 'echo `for` echo ".BAD"CODE.' | sh +m -i 2>&1 | grep -q BADCODE && exit 1 exit 0 Modified: stable/8/tools/regression/bin/sh/execution/func2.0 ============================================================================== --- stable/8/tools/regression/bin/sh/execution/func2.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/execution/func2.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,4 +1,5 @@ # $FreeBSD$ +# The empty pairs of braces here are to test that this does not cause a crash. f() { } f Copied: stable/8/tools/regression/bin/sh/expansion/ifs3.0 (from r211622, head/tools/regression/bin/sh/expansion/ifs3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/bin/sh/expansion/ifs3.0 Mon Oct 18 23:10:32 2010 (r214045, copy of r211622, head/tools/regression/bin/sh/expansion/ifs3.0) @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures=0 +unset LC_ALL +export LC_CTYPE=en_US.ISO8859-1 +i=128 +set -f +while [ "$i" -le 255 ]; do + i2=$((i^2)) + c=$(printf \\"$(printf %o "$i")") + c2=$(printf \\"$(printf %o "$i2")") + IFS=$c + set -- $c2$c$c2$c$c2 + if [ "$#" -ne 3 ] || [ "$1" != "$c2" ] || [ "$2" != "$c2" ] || + [ "$3" != "$c2" ]; then + echo "Bad results for separator $i (word $i2)" >&2 + : $((failures += 1)) + fi + i=$((i+1)) +done +exit $((failures > 0)) Modified: stable/8/tools/regression/bin/sh/set-e/elif1.0 ============================================================================== --- stable/8/tools/regression/bin/sh/set-e/elif1.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/set-e/elif1.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,5 +1,7 @@ # $FreeBSD$ set -e if false; then + : elif false; then + : fi Modified: stable/8/tools/regression/bin/sh/set-e/elif2.0 ============================================================================== --- stable/8/tools/regression/bin/sh/set-e/elif2.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/set-e/elif2.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,5 +1,7 @@ # $FreeBSD$ set -e if false; then + : elif false; false; then + : fi Modified: stable/8/tools/regression/bin/sh/set-e/if1.0 ============================================================================== --- stable/8/tools/regression/bin/sh/set-e/if1.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/set-e/if1.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e if false; then + : fi Modified: stable/8/tools/regression/bin/sh/set-e/if3.0 ============================================================================== --- stable/8/tools/regression/bin/sh/set-e/if3.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/set-e/if3.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e if false; false; then + : fi Modified: stable/8/tools/regression/bin/sh/set-e/while1.0 ============================================================================== --- stable/8/tools/regression/bin/sh/set-e/while1.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/set-e/while1.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e while false; do + : done Modified: stable/8/tools/regression/bin/sh/set-e/while2.0 ============================================================================== --- stable/8/tools/regression/bin/sh/set-e/while2.0 Mon Oct 18 22:30:58 2010 (r214044) +++ stable/8/tools/regression/bin/sh/set-e/while2.0 Mon Oct 18 23:10:32 2010 (r214045) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e while false; false; do + : done