Move of test programs to t subdirectory.
[gedcom-parse.git] / t / test_script
1 #!/bin/sh
2 # $Id$
3 # $Name$
4
5 options="-q"
6
7 while [ $# -gt 0 ]
8 do
9   case "$1" in
10     -*) options="$options $1";;
11     *)  break;;
12   esac
13   shift
14 done
15
16 file=$1
17 expected_result=$2
18 if [ -z "$expected_result" ]
19 then
20   expected_result=0
21 fi
22
23 builddir=`pwd`
24 cd $srcdir/..
25 export GCONV_PATH=./ansel:$GCONV_PATH
26 export LD_LIBRARY_PATH=$builddir/../gedcom/.libs:$LD_LIBRARY_PATH
27 cp $builddir/../ansel/.libs/ANSI_Z39.47.so ansel
28 $builddir/testgedcom $options t/input/$file
29 result=$?
30 rm ansel/ANSI_Z39.47.so
31 if [ "$result" -eq "$expected_result" ]
32 then
33   exit 0
34 else
35   exit 1
36 fi