# $Id$
# $Name$
-options="-q"
-extra_options=
-dmalloc=`which dmalloc`
-dmalloc_tmp=dmalloc.env
+builddir=`pwd`
+if [ -z "$srcdir" ]
+then
+ srcdir=.
+fi
-while [ $# -gt 0 ]
-do
- case "$1" in
- -*) extra_options="$extra_options $1";;
- *) break;;
- esac
- shift
-done
+. $srcdir/src/test_prologue.sh
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=$srcdir/input/$file
- options="$options $extra_options"
+ case $file in
+ ./*) testfile=$file ;;
+ *) testfile=$srcdir/input/$file ;;
+ esac
fi
-builddir=`pwd`
-ltcmd="$srcdir/../libtool --mode=execute -dlopen $builddir/../gedcom/libgedcom.la -dlopen $builddir/../gom/libgedcom_gom.la"
-export GCONV_PATH=.:$GCONV_PATH
-ln -s $srcdir/../data/gedcom.enc .
-ln -s $builddir/../iconv/glibc/.libs/ANSI_Z39.47.so .
-ln -s $srcdir/../iconv/glibc/gconv-modules .
-rm -f core
-if [ "$GOM_DMALLOC_TEST" = "" ]
-then
- $ltcmd $GEDCOM_TESTENV $builddir/src/gomtest $options $testfile
-else
- $dmalloc -b -l $GOM_DMALLOC_TEST -i 100 low > $dmalloc_tmp
- . $dmalloc_tmp
- rm $dmalloc_tmp
- $ltcmd $GEDCOM_TESTENV $builddir/src/gomtest_static $options $testfile
-fi
-result=$?
-rm gedcom.enc
-rm ANSI_Z39.47.so
-rm gconv-modules
-if [ "$result" -eq "$expected_result" -a ! -r core ]
-then
- exit 0
-else
- exit 1
-fi
+test_program=gomtest
+test_libs="$builddir/../gedcom/libgedcom.la $builddir/../gom/libgedcom_gom.la"
+test_args=$testfile
+
+. $srcdir/src/test_bulk.sh