X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=t%2Ftest_script;h=c5b68159aee3fa4d2959f849bebf25192b536337;hb=44733edab79a63ea04c25dca3ae0a64cd9bb46fb;hp=cec97924296073ea097f571ec8ddc43287fd77ff;hpb=46ed72bc448eb293a9ed2492ac254acc676699fd;p=gedcom-parse.git diff --git a/t/test_script b/t/test_script index cec9792..c5b6815 100755 --- a/t/test_script +++ b/t/test_script @@ -2,15 +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=t/input/$file + options="$options $extra_options" +fi builddir=`pwd` cd $srcdir/.. -export GCONV_PATH=$GCONV_PATH:./ansel -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$builddir/../gedcom/.libs +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 -echo "=== testing $file" -$builddir/../testgedcom -2 t/$file +$builddir/testgedcom $options $testfile result=$? rm ansel/ANSI_Z39.47.so -exit $result +if [ "$result" -eq "$expected_result" ] +then + exit 0 +else + exit 1 +fi