Tests for moving xrefs in a list.
[gedcom-parse.git] / t / src / test_bulk.sh
1 # $Id$
2 # $Name$
3 # Common test part for the test scripts
4
5 ltcmd="$builddir/../libtool --mode=execute"
6 for lib in $test_libs $builddir/../utf8/libutf8tools.la
7 do
8   ltcmd="$ltcmd -dlopen $lib"
9 done
10
11 echo "======================================================">> $logfile
12 echo "Performing test '$test_name'" >> $logfile
13
14 if [ "$GEDCOM_NOOPTS" ]
15 then
16   echo "Following options would be passed: $options $test_args"
17   options=
18   test_args=
19 fi
20
21 $ltcmd $GEDCOM_TESTENV $builddir/src/$test_program $options $test_args
22 result=$?
23 rm gedcom.enc
24 rm new.ged
25 rm ANSI_Z39.47.so
26 rm gconv-modules
27
28 echo "Result is $result (expected: $expected_result)" >> $logfile
29 if [ "$result" -ne "$expected_result" ]
30 then
31   echo "Not the expected return value!" >> $logfile
32   exit 1
33 else
34   if [ -r core ]
35   then
36     echo "Core file generated!" >> $logfile
37     exit 1
38   else
39     if diff $outfile $reffile >/dev/null 2>>$logfile
40     then
41       echo "Output agrees with reference output" >> $logfile
42       rm $outfile
43       if [ "$gedcom_out" ]
44       then
45         if diff $gedfile $gedreffile >/dev/null 2>>$logfile
46         then
47           echo "Gedcom output agrees with reference output" >> $logfile
48           rm $gedfile
49           exit 0
50         else
51           echo "Differences with reference gedcom output detected!" >> $logfile
52           exit 1
53         fi
54       fi
55       exit 0
56     else
57       echo "Differences with reference output detected!" >> $logfile
58       exit 1
59     fi
60   fi
61 fi