be99800edc53705bcc412468d41989cc0b380c7c
[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 GCONV_PATH=.:$GCONV_PATH
11 export GCONV_PATH
12 ln -s $srcdir/../data/gedcom.enc .
13 ln -s $builddir/../iconv/glibc/.libs/ANSI_Z39.47.so .
14 ln -s $srcdir/../iconv/glibc/gconv-modules .
15
16 retval=0
17
18 if [ "$ICONV_PATH" ]
19 then
20   PATH=$ICONV_PATH:$PATH
21   export PATH
22 fi
23
24 echo "Testing conversion from ANSEL to UTF-8" >> testgedcom.out
25 iconv -f ANSEL -t UTF-8 $srcdir/input/ansel.ged > anselutf8.out
26 if diff $srcdir/input/anselutf8.ged anselutf8.out >> testgedcom.out
27 then
28   echo "Testing conversion from UTF-8 to ANSEL" >> testgedcom.out
29   iconv -f UTF-8 -t ANSEL $srcdir/input/anselutf8.ged > ansel.out
30   if diff $srcdir/input/ansel.ged ansel.out >> testgedcom.out
31   then
32     :
33   else
34     retval=1
35   fi
36 else
37   retval=1
38 fi
39
40 rm gedcom.enc
41 rm ANSI_Z39.47.so
42 rm gconv-modules
43 exit $retval