Fixes for portability with libiconv.
[gedcom-parse.git] / t / anselconv.test
1 #!/bin/sh
2
3 # For use outside Makefile
4 if [ -z "$srcdir" ]
5 then
6   srcdir=.
7 fi
8 builddir=`pwd`
9
10 export GCONV_PATH=.:$GCONV_PATH
11 ln -s $srcdir/../data/gedcom.enc .
12 ln -s $builddir/../iconv/glibc/.libs/ANSI_Z39.47.so .
13 ln -s $srcdir/../iconv/glibc/gconv-modules .
14
15 retval=0
16
17 if [ "$ICONV_PATH" ]
18 then
19   export PATH=$ICONV_PATH:$PATH
20 fi
21
22 echo "Testing conversion from ANSEL to UTF-8" >> testgedcom.out
23 iconv -f ANSEL -t UTF-8 input/ansel.ged > anselutf8.out
24 if ! diff input/anselutf8.ged anselutf8.out >> testgedcom.out
25 then
26   retval=1
27 else
28   echo "Testing conversion from UTF-8 to ANSEL" >> testgedcom.out
29   iconv -f UTF-8 -t ANSEL input/anselutf8.ged > ansel.out
30   if ! diff input/ansel.ged ansel.out >> testgedcom.out
31   then
32     retval=1
33   fi
34 fi
35
36 rm gedcom.enc
37 rm ANSI_Z39.47.so
38 rm gconv-modules
39 exit $retval