2
# scilab batch execution for testing
3
# scidem scidir fn fileres flag
4
echo ------------------- File $2--------------------
7
if [ -f $3 ]; then rm $3;fi;
8
trap "rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff\
10
echo "clear;lines(0);deff('[]=bugmes()','write(%io(2),''error on test'')');\
11
diary('$3');driver('Pos');" >> /tmp/$2.$$ ;
12
sed -e "s/pause,end/bugmes();quit;end/" \
15
echo "diary(0);xend();exit;" >> /tmp/$2.$$ ;
16
(cat /tmp/$2.$$ | $SCI/bin/scilex -nwni > /tmp/$2.$$.res ) 2> /tmp/$2.$$.err ;
17
sed -e "s/ \./0\./g" -e "s/E+/D+/g" -e "s/E-/D-/g" -e "s/-\./-0\./g" -e "s/^-->//g" -e "s/^-1->//g" $3 > $3.n
18
grep -v "xinit(" $3.n | grep -v "diary(" | grep -v "exec(" > $3
20
if ( grep error /tmp/$2.$$.res > /dev/null ) ; then
22
echo "Test failed ERROR DETECTED while executing $2" ;
24
else if [ -f $3.ref ];then
25
if ( diff -w $3 $3.ref > /tmp/$2.$$.diff ) ;
26
then echo Test passed ;
27
else echo Test Failed SEE : diff -w $3 $3.ref ;
31
echo ----------------------------------------------------------
32
rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff