X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=t%2Fsrc%2Ftest_gom;h=90d859c14f3cf1d0acd0ff7f6800158a293b5b41;hb=ea81accae13a4617cc46f5256dad50e2732cc206;hp=108f4981f2f7421b4a335c5b317cd4d4b69039fd;hpb=cf73759d92858885e4e71f6fc85f6d4478593958;p=gedcom-parse.git diff --git a/t/src/test_gom b/t/src/test_gom index 108f498..90d859c 100755 --- a/t/src/test_gom +++ b/t/src/test_gom @@ -2,90 +2,28 @@ # $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 -test_name=$2 -expected_result=$3 -if [ -z "$test_name" ] -then - test_name=check -fi -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 -outfile=$test_name.out -logfile=check.out -reffile=$srcdir/output/$test_name.ref -options="$options -o $outfile" - -builddir=`pwd` -ltcmd="$builddir/../libtool --mode=execute -dlopen $builddir/../gedcom/libgedcom.la -dlopen $builddir/../gom/libgedcom_gom.la" -GCONV_PATH=.:$GCONV_PATH -export 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 -echo "======================================================">> $logfile -echo "Performing test '$test_name'" >> $logfile -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 +test_program=gomtest +test_libs="$builddir/../gedcom/libgedcom.la $builddir/../gom/libgedcom_gom.la" +test_args=$testfile -echo "Result is $result (expected: $expected_result)" >> $logfile -if [ "$result" -ne "$expected_result" ] -then - exit 1 -else - if [ -r core ] - then - echo "Core file generated!" >> $logfile - exit 1 - else - if diff $outfile $reffile >/dev/null 2>>$logfile - then - echo "Output agrees with reference output" >> $logfile - rm $outfile - exit 0 - else - echo "Differences with reference output detected!" >> $logfile - exit 1 - fi - fi -fi +. $srcdir/src/test_bulk.sh