From 93693c4d820dac2f218e144f5126a5a761f1cfbf Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 5 Feb 2001 05:57:24 +0000 Subject: Update. 2001-02-04 Ulrich Drepper * iconv/Makefile (iconv_prog-modules): Define. Add vpath to find files in locale/programs. Add CFLAGS definition to allow compiling localedef files. * iconv/dummy-repertoire.c: New file. * iconv/iconv_charmap.c: New file. * iconv/iconv_prog.h: New file. * iconv/iconv_prog.c: Make verbose and omit_invalid global. (main): If parameter for -f and -t contain slashes try first to resolve the strings as filenames of charmap files. Use them for conversion in this case. * iconvdata/run-iconv-test.sh: If charmaps exist also run tests with iconv getting charmap names as parameters. * locale/programs/linereader.c (lr_token): Take extra parameters verbose and pass it to get_string. (get_string): Take extra parameters verbose. * locale/programs/charmap.c (parse_charmap): Take extra parameters verbose and be_quiet. Change all callers of lr_token and parse_charmap. * locale/programs/charmap.h: Likewise. * locale/programs/ld-address.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-identification.c: Likewise. * locale/programs/ld-measurement.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-name.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-paper.c: Likewise. * locale/programs/ld-telephone.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/linereader.c: Likewise. * locale/programs/linereader.h: Likewise. * locale/programs/localedef.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/locfile.h: Likewise. * locale/programs/repertoire.c: Likewise. --- iconvdata/run-iconv-test.sh | 58 ++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 22 deletions(-) (limited to 'iconvdata/run-iconv-test.sh') diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh index e20d19689a..3388e80074 100755 --- a/iconvdata/run-iconv-test.sh +++ b/iconvdata/run-iconv-test.sh @@ -59,13 +59,10 @@ while read from to subset targets; do if test -n "$targets"; then for t in $targets; do if test -f testdata/$from; then - echo $ac_n "test data: $from -> $t $ac_c" + echo $ac_n " test data: $from -> $t $ac_c" $PROG -f $from -t $t testdata/$from > $temp1 || { if test $? -gt 128; then exit 1; fi - echo "FAILED" - failed=1 - continue - } + echo "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 || @@ -75,10 +72,7 @@ while read from to subset targets; do echo $ac_n " -> $from $ac_c" $PROG -f $t -t $to -o $temp2 $temp1 || { if test $? -gt 128; then exit 1; fi - echo "FAILED" - failed=1 - continue - } + echo "FAILED"; failed=1; continue; } echo $ac_n "OK$ac_c" test -s $temp1 && cmp testdata/$from $temp2 > /dev/null 2>&1 || { echo "/FAILED"; failed=1; continue; } @@ -90,21 +84,45 @@ while read from to subset targets; do # of the coded character set we convert the text to this coded character # set. Otherwise we convert to all the TARGETS. if test $subset = Y; then - echo $ac_n " suntzu: $from -> $t -> $to $ac_c" + echo $ac_n " suntzu: $from -> $t -> $to $ac_c" $PROG -f $from -t $t testdata/suntzus | $PROG -f $t -t $to > $temp1 || { if test $? -gt 128; then exit 1; fi - echo "FAILED" - failed=1 - continue - } + echo "FAILED"; failed=1; continue; } echo $ac_n "OK$ac_c" cmp testdata/suntzus $temp1 || - { echo "/FAILED"; - failed=1; continue; } + { echo "/FAILED"; failed=1; continue; } echo "/OK" fi rm -f $temp1 + + # And tests where iconv(1) has to handle charmaps. + if test "$t" = UTF8; then tc=UTF-8; else tc="$t"; fi + if test -f ../localedata/charmaps/$from && + test -f ../localedata/charmaps/$tc && + test -f testdata/$from; then + echo $ac_n "test charmap: $from -> $t $ac_c" + $PROG -f ../localedata/charmaps/$from -t ../localedata/charmaps/$tc \ + testdata/$from > $temp1 || + { if test $? -gt 128; then exit 1; fi + echo "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 "/FAILED"; failed=1; continue; } + echo $ac_n "/OK$ac_c" + fi + echo $ac_n " -> $from $ac_c" + $PROG -t ../localedata/charmaps/$from -f ../localedata/charmaps/$tc \ + -o $temp2 $temp1 || + { if test $? -gt 128; then exit 1; fi + echo "FAILED"; failed=1; continue; } + echo $ac_n "OK$ac_c" + test -s $temp1 && cmp testdata/$from $temp2 > /dev/null 2>&1 || + { echo "/FAILED"; failed=1; continue; } + echo "/OK" + rm -f $temp1 $temp2 + fi done fi @@ -113,14 +131,10 @@ while read from to subset targets; do $PROG -f ASCII -t $to testdata/suntzus | $PROG -f $to -t ASCII > $temp1 || { if test $? -gt 128; then exit 1; fi - echo "FAILED" - failed=1 - continue - } + echo "FAILED"; failed=1; continue; } echo $ac_n "OK$ac_c" cmp testdata/suntzus $temp1 || - { echo "/FAILED"; - failed=1; continue; } + { echo "/FAILED"; failed=1; continue; } echo "/OK" fi done < TESTS -- cgit v1.2.3