Have a way to test with a different language, through GEDCOM_LANG.
[gedcom-parse.git] / t / src / test_prologue.sh
1 # $Id$
2 # $Name$
3 # Common prologue for the test scripts
4
5 extra_options=
6
7 while [ $# -gt 0 ]
8 do
9   case "$1" in
10     -*) extra_options="$extra_options $1";;
11     *)  break;;
12   esac
13   shift
14 done
15
16 test_name=$1
17 shift
18 expected_result=$1
19 shift
20 if [ -z "$test_name" ]
21 then
22   test_name=check
23 fi
24 if [ -z "$expected_result" ]
25 then
26   expected_result=0
27 fi
28 if [ -z "$GEDCOM_LANG" ]
29 then
30   GEDCOM_LANG=C
31 fi
32
33 # For use outside Makefile
34 if [ -z "$srcdir" ]
35 then
36   :
37 else
38   options="-q $extra_options"
39 fi
40
41 outfile=$test_name.out
42 logfile=check.out
43 reffile=$srcdir/output/$test_name.ref
44 options="$options -o $outfile"
45
46 GCONV_PATH=.:$GCONV_PATH
47 export GCONV_PATH
48 LC_ALL=$GEDCOM_LANG
49 export LC_ALL
50 ln -s $srcdir/../data/gedcom.enc .
51 ln -s $builddir/../data/new.ged .
52 ln -s $builddir/../iconv/glibc/.libs/ANSI_Z39.47.so .
53 ln -s $srcdir/../iconv/glibc/gconv-modules .
54 rm -f core