[ksh] fix regression tests
Michal Hlavinka
mhlavink at fedoraproject.org
Fri Nov 26 10:45:53 UTC 2010
commit 4e7626d192824ff4c40ad167ea435898587856cc
Author: Michal Hlavinka <mhlavink at redhat.com>
Date: Fri Nov 26 11:45:52 2010 +0100
fix regression tests
expectedresults.log | 6 ------
ksh-20100826-fixregr.patch | 32 ++++++++++++++++++--------------
ksh.spec | 3 ++-
3 files changed, 20 insertions(+), 21 deletions(-)
---
diff --git a/expectedresults.log b/expectedresults.log
index 1d8a0e4..e69de29 100644
--- a/expectedresults.log
+++ b/expectedresults.log
@@ -1,6 +0,0 @@
- builtins.sh[296]: printf "%T" nowTue Nov 23 07:50:27 GMT 2010 != Tue Nov 23 07:50:27 UTC 2010
-test builtins failed [ 132 tests 1 error ]
- builtins.sh[296]: printf "%T" nowTue Nov 23 07:50:27 GMT 2010 != Tue Nov 23 07:50:27 UTC 2010
-test builtins(C.UTF-8) failed [ 132 tests 1 error ]
- shcomp-builtins.ksh[296]: printf "%T" nowTue Nov 23 07:50:27 GMT 2010 != Tue Nov 23 07:50:27 UTC 2010
-test builtins(shcomp) failed [ 132 tests 1 error ]
diff --git a/ksh-20100826-fixregr.patch b/ksh-20100826-fixregr.patch
index 9b7cc35..1b7fdbe 100644
--- a/ksh-20100826-fixregr.patch
+++ b/ksh-20100826-fixregr.patch
@@ -1,19 +1,23 @@
-diff -up ksh-20101026/src/cmd/ksh93/tests/builtins.sh.fixregr ksh-20101026/src/cmd/ksh93/tests/builtins.sh
---- ksh-20101026/src/cmd/ksh93/tests/builtins.sh.fixregr 2010-10-27 08:52:38.000000000 +0200
-+++ ksh-20101026/src/cmd/ksh93/tests/builtins.sh 2010-11-01 08:49:42.135892758 +0100
-@@ -293,7 +293,7 @@ fi
+diff -up ksh-20101122/src/cmd/ksh93/tests/builtins.sh.fixregr ksh-20101122/src/cmd/ksh93/tests/builtins.sh
+--- ksh-20101122/src/cmd/ksh93/tests/builtins.sh.fixregr 2010-10-27 08:52:38.000000000 +0200
++++ ksh-20101122/src/cmd/ksh93/tests/builtins.sh 2010-11-26 10:17:05.653551931 +0100
+@@ -291,9 +291,9 @@ then err_exit "printf '%..*s' not workin
+ fi
+ [[ $(printf '%q\n') == '' ]] || err_exit 'printf "%q" with missing arguments'
# we won't get hit by the one second boundary twice, right?
- [[ $(printf '%T\n' now) == "$(date)" ]] ||
- [[ $(printf '%T\n' now) == "$(date)" ]] ||
+-[[ $(printf '%T\n' now) == "$(date)" ]] ||
+-[[ $(printf '%T\n' now) == "$(date)" ]] ||
-err_exit 'printf "%T" now'
-+err_exit 'printf "%T" now'"$(printf '%T\n' now) != $(date)"
++[[ $(printf '%T\n' now | sed 's/GMT/UTC/') == "$(date)" ]] ||
++[[ $(printf '%T\n' now | sed 's/GMT/UTC/') == "$(date)" ]] ||
++err_exit 'printf "%T" now = '"$(printf '%T\n' now) != $(date)"
behead()
{
read line
-diff -up ksh-20101026/src/cmd/ksh93/tests/locale.sh.fixregr ksh-20101026/src/cmd/ksh93/tests/locale.sh
---- ksh-20101026/src/cmd/ksh93/tests/locale.sh.fixregr 2010-10-26 12:12:34.000000000 +0200
-+++ ksh-20101026/src/cmd/ksh93/tests/locale.sh 2010-11-01 09:37:38.719975976 +0100
-@@ -105,6 +105,7 @@ if (( $($SHELL -c $'export LC_ALL='$loca
+diff -up ksh-20101122/src/cmd/ksh93/tests/locale.sh.fixregr ksh-20101122/src/cmd/ksh93/tests/locale.sh
+--- ksh-20101122/src/cmd/ksh93/tests/locale.sh.fixregr 2010-11-13 01:29:23.000000000 +0100
++++ ksh-20101122/src/cmd/ksh93/tests/locale.sh 2010-11-26 10:08:17.334737934 +0100
+@@ -104,6 +104,7 @@ if (( $($SHELL -c $'export LC_ALL='$loca
then LC_ALL=$locale $SHELL -c b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254"; [[ ${b1:4:1} == w ]]' || err_exit 'multibyte ${var:offset:len} not working correctly'
fi
@@ -21,7 +25,7 @@ diff -up ksh-20101026/src/cmd/ksh93/tests/locale.sh.fixregr ksh-20101026/src/cmd
#$SHELL -c 'export LANG='$locale'; printf "\u[20ac]\u[20ac]" > $tmp/two_euro_chars.txt'
printf $'\342\202\254\342\202\254' > $tmp/two_euro_chars.txt
exp="6 2 6"
-@@ -112,11 +113,11 @@ set -- $($SHELL -c "
+@@ -111,11 +112,11 @@ set -- $($SHELL -c "
unset LC_CTYPE
export LANG=$locale
export LC_ALL=C
@@ -36,7 +40,7 @@ diff -up ksh-20101026/src/cmd/ksh93/tests/locale.sh.fixregr ksh-20101026/src/cmd
")
got=$*
[[ $got == $exp ]] || err_exit "command wc LC_ALL default failed -- expected '$exp', got '$got'"
-@@ -135,6 +136,8 @@ set -- $($SHELL -c "
+@@ -134,6 +135,8 @@ set -- $($SHELL -c "
got=$*
[[ $got == $exp ]] || err_exit "builtin wc LC_ALL default failed -- expected '$exp', got '$got'"
@@ -45,7 +49,7 @@ diff -up ksh-20101026/src/cmd/ksh93/tests/locale.sh.fixregr ksh-20101026/src/cmd
# multibyte char straddling buffer boundary
{
-@@ -191,6 +194,7 @@ do exp=$1
+@@ -190,6 +193,7 @@ do exp=$1
done
# setocale(LC_ALL,"") after setlocale() initialization
diff --git a/ksh.spec b/ksh.spec
index e5860ab..f1a81c8 100644
--- a/ksh.spec
+++ b/ksh.spec
@@ -24,6 +24,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Conflicts: pdksh
Requires: coreutils, glibc-common, diffutils
BuildRequires: bison
+# regression test suite uses 'ps' from procps
+BuildRequires: procps
Requires(post): grep, coreutils
Requires(preun): grep, coreutils
@@ -73,7 +75,6 @@ then
fi
$SHELL ./shtests 2>&1 | tee testresults.log
sed -e '/begins at/d' -e '/ 0 error/d' -e 's/at [^\[]*\[/\[/' testresults.log -e '/tests skipped/d' >filteredresults.log
-exit 0
if ! cmp filteredresults.log %{SOURCE5} >/dev/null || ls core.*
then
echo "Regression tests failed"
More information about the scm-commits
mailing list