~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to util/scidem-gcwin32

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh 
 
2
# scilab batch execution for testing 
 
3
# scidem scidir fn fileres  flag
 
4
echo ------------------- File $2--------------------
 
5
SCI=$1
 
6
export SCI
 
7
if [ -f $3  ]; then rm $3;fi;
 
8
trap "rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff\
 
9
        ;exit 1"  1 2 13 15
 
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/" \
 
13
        -e "s/halt()//" \
 
14
        $2 >> /tmp/$2.$$ ;
 
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
 
19
rm -f $3.n
 
20
if ( grep error /tmp/$2.$$.res >  /dev/null ) ; then 
 
21
        if [ $# != 4 ]; then 
 
22
                echo "Test failed ERROR DETECTED  while executing $2" ;
 
23
        fi;
 
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 ;
 
28
        fi;
 
29
      fi;
 
30
fi;
 
31
echo ---------------------------------------------------------- 
 
32
rm -f /tmp/$2.$$ /tmp/$2.$$.res /tmp/$2.$$.err /tmp/$2.$$.diff
 
33
exit 0
 
34