X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=t%2Ftest_script;h=0623403ac034204c30243a2731ccbad575fbfabb;hb=e4ccfb6a6f26881db3874841a5aa2c2201a9c4e0;hp=ed62f9b31ffc403693ea457b6f01176438f493ce;hpb=a1ee3a539fc8a1e4f5a1c39c488723c4a5870a11;p=gedcom-parse.git diff --git a/t/test_script b/t/test_script index ed62f9b..0623403 100755 --- a/t/test_script +++ b/t/test_script @@ -3,11 +3,12 @@ # $Name$ options="-q" +extra_options= while [ $# -gt 0 ] do case "$1" in - -*) options="$options $1";; + -*) extra_options="$extra_options $1";; *) break;; esac shift @@ -20,15 +21,30 @@ then expected_result=0 fi +# For use outside Makefile +if [ -z "$srcdir" ] +then + testfile=$file + srcdir=. + options=$extra_options +else + testfile=$srcdir/input/$file + options="$options $extra_options" +fi + builddir=`pwd` -cd $srcdir/.. -export GCONV_PATH=./ansel:$GCONV_PATH +export GCONV_PATH=.:$GCONV_PATH export LD_LIBRARY_PATH=$builddir/../gedcom/.libs:$LD_LIBRARY_PATH -cp $builddir/../ansel/.libs/ANSI_Z39.47.so ansel -$builddir/testgedcom $options t/input/$file +ln -s $srcdir/../gedcom.enc . +ln -s $builddir/../ansel/.libs/ANSI_Z39.47.so . +ln -s $srcdir/../ansel/gconv-modules . +rm -f core +$builddir/testgedcom $options $testfile result=$? -rm ansel/ANSI_Z39.47.so -if [ "$result" -eq "$expected_result" ] +rm gedcom.enc +rm ANSI_Z39.47.so +rm gconv-modules +if [ "$result" -eq "$expected_result" -a ! -r core ] then exit 0 else