about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rwxr-xr-xiconvdata/run-iconv-test.sh32
2 files changed, 27 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index de832496c4..775f6eb2fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-12-27  Ulrich Drepper  <drepper@cygnus.com>
 
+	* iconvdata/run-iconv-test.sh: Improve test output a bit to allow
+	identifying errors more easily.
+
 	* iconvdata/testdata/EUC-CN..UTF8: New file.
 	* iconvdata/testdata/GBK..UTF8: New file.
 
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