New test, to test ansel conversion.
[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/../ansel/.libs/ANSI_Z39.47.so .
13 ln -s $srcdir/../ansel/gconv-modules .
14
15 retval=0
16
17 if [ "$ICONV_PATH" ]
18 then
19   export PATH=$ICONV_PATH:$PATH
20 fi
21
22 iconv --from-code=ANSEL --to-code=UTF-8 input/ansel.ged -o anselutf8.out
23 if ! diff input/anselutf8.ged anselutf8.out
24 then
25   retval=1
26 else
27   iconv --to-code=ANSEL --from-code=UTF-8 input/anselutf8.ged -o ansel.out
28   if ! diff input/ansel.ged ansel.out
29   then
30     retval=1
31   fi
32 fi
33
34 rm gedcom.enc
35 rm ANSI_Z39.47.so
36 rm gconv-modules
37 exit $retval