summaryrefslogtreecommitdiff
path: root/iconvdata/run-iconv-test.sh
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-12-28 07:12:35 +0000
committerUlrich Drepper <drepper@redhat.com>1999-12-28 07:12:35 +0000
commit822078f617658091381b55f866a3b4b4392b5fd4 (patch)
treeba366a8fab232fb96c78099772ec995a83b2e530 /iconvdata/run-iconv-test.sh
parentcb852d06a9242442b2643df86af3fbee7aa29518 (diff)
Update.
* iconvdata/run-iconv-test.sh: Improve test output a bit to allow identifying errors more easily.
Diffstat (limited to 'iconvdata/run-iconv-test.sh')
-rwxr-xr-xiconvdata/run-iconv-test.sh32
1 files changed, 24 insertions, 8 deletions
diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh
index 17f58ba41c..af9a44f66e 100755
--- a/iconvdata/run-iconv-test.sh
+++ b/iconvdata/run-iconv-test.sh
@@ -1,6 +1,6 @@
#! /bin/sh -f
# Run available iconv(1) tests.
-# Copyright (C) 1998 Free Software Foundation, Inc.
+# Copyright (C) 1998, 1999 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
#
@@ -39,6 +39,13 @@ LIBPATH=$codir:$codir/iconvdata
ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
$codir/iconv/iconv_prog'
+# Which echo?
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ ac_n=-n ac_c= ac_t=
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
# We read the file named TESTS. All non-empty lines not starting with
# `#' are interpreted as commands.
failed=0
@@ -50,41 +57,50 @@ while read from to subset targets; do
PROG=`eval echo $ICONV`
for t in $targets; do
+ echo $ac_n "test data: $from -> $to $ac_c"
$PROG -f $from -t $t testdata/$from > $temp1 ||
{ echo "*** conversion from $from to $t failed"; failed=1; continue; }
+ echo $ac_n "OK$ac_c"
if test -s testdata/$from..$t; then
cmp $temp1 testdata/$from..$t > /dev/null 2>&1 ||
- { echo "*** $from -> $t conversion failed"; failed=1; continue; }
+ { echo "/FAILED"; failed=1; continue; }
+ echo $ac_n "/OK$ac_c"
fi
+ echo $ac_n " -> $from $ac_c"
$PROG -f $t -t $to -o $temp2 $temp1 ||
{ echo "*** conversion from $t to $to failed"; failed=1; continue; }
+ echo $ac_n "OK$ac_c"
test -s $temp1 && cmp testdata/$from $temp2 > /dev/null 2>&1 ||
{ echo "*** $from -> t -> $to conversion failed"; failed=1; continue; }
+ echo "/OK"
rm -f $temp1 $temp2
# Now test some bigger text, entirely in ASCII. If ASCII is no subset
# of the coded character set we test we convert the test to this
# coded character set. Otherwise we convert to all the TARGETS.
if test $subset = Y; then
+ echo $ac_n " suntzu: $from -> $to $ac_c"
$PROG -f $from -t $t testdata/suntzus |
$PROG -f $t -t $to > $temp1 ||
- { echo "*** conversion $from->$t->$to of suntzus failed"; failed=1;
+ { echo "FAILED"; failed=1;
continue; }
+ echo $ac_n "OK$ac_c"
cmp testdata/suntzus $temp1 ||
- { echo "*** conversion $from->$t->$to of suntzus incorrect";
+ { echo "/FAILED";
failed=1; continue; }
else
+ echo $ac_n "; suntzu: $from -> ASCII $ac_c"
$PROG -f ASCII -t $to testdata/suntzus |
$PROG -f $to -t ASCII > $temp1 ||
- { echo "*** conversion ASCII->$to->ASCII of suntzus failed";
+ { echo "FAILED";
failed=1; continue; }
+ echo $ac_n "OK$ac_c"
cmp testdata/suntzus $temp1 ||
- { echo "*** conversion ASCII->$to->ASCII of suntzus incorrect";
+ { echo "/FAILED";
failed=1; continue; }
fi
+ echo "/OK"
rm -f $temp1
- # All tests ok.
- echo "$from -> $t -> $to ok"
done
done < TESTS