X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=t%2Ftest_script;h=f8f365236629109247fbe1d02b5fc9f0757c87a4;hb=658c8f10d582c24175bf351d8965413ada9cfb42;hp=fdef281fd7a660941217534e430e51cb0a8d0f0b;hpb=a106c3be801ba19082ed52d14624bb2770bb6ef3;p=gedcom-parse.git diff --git a/t/test_script b/t/test_script index fdef281..f8f3652 100755 --- a/t/test_script +++ b/t/test_script @@ -2,13 +2,47 @@ # $Id$ # $Name$ +options="-q" +extra_options= + +while [ $# -gt 0 ] +do + case "$1" in + -*) extra_options="$extra_options $1";; + *) break;; + esac + shift +done + file=$1 +expected_result=$2 +if [ -z "$expected_result" ] +then + expected_result=0 +fi + +# For use outside Makefile +if [ -z "$srcdir" ] +then + testfile=$file + srcdir=. + options=$extra_options +else + testfile=input/$file + options="$options $extra_options" +fi builddir=`pwd` -cd $srcdir/.. -export GCONV_PATH=./ansel -export LD_LIBRARY_PATH=$builddir/../gedcom/.libs -cp $builddir/../ansel/.libs/ANSI_Z39.47.so ansel -echo "=== testing $file" -$builddir/../testgedcom -2 t/$file -rm ansel/ANSI_Z39.47.so +export GCONV_PATH=../ansel:$GCONV_PATH +export LD_LIBRARY_PATH=$builddir/../gedcom/.libs:$LD_LIBRARY_PATH +cp $builddir/../ansel/.libs/ANSI_Z39.47.so ../ansel +rm -f core +$builddir/testgedcom $options $testfile +result=$? +rm ../ansel/ANSI_Z39.47.so +if [ "$result" -eq "$expected_result" -a ! -r core ] +then + exit 0 +else + exit 1 +fi