svn commit: r214045 - in stable/8/tools/regression/bin/sh: builtins
errors execution expansion set-e
David E. O'Brien
obrien at FreeBSD.org
Mon Oct 18 23:10:32 UTC 2010
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
More information about the svn-src-stable
mailing list