From 822078f617658091381b55f866a3b4b4392b5fd4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 28 Dec 1999 07:12:35 +0000 Subject: Update. * iconvdata/run-iconv-test.sh: Improve test output a bit to allow identifying errors more easily. --- iconvdata/run-iconv-test.sh | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'iconvdata/run-iconv-test.sh') 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 , 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 -- cgit v1.2.3