File: dotest.in

package info (click to toggle)
gp2c 0.0.5pl2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,508 kB
  • ctags: 1,114
  • sloc: ansic: 8,284; sh: 544; lex: 337; yacc: 158; makefile: 135
file content (36 lines) | stat: -rwxr-xr-x 1,015 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /bin/sh -e
bugs=0
testdir=`cd "$srcdir/test" && pwd`
cd test
GP2C_FUNC_DSC=../desc/func.dsc
export GP2C_FUNC_DSC
for i in `ls "$testdir/input"`; do
  if test -f "$testdir/gp/$i.gp"; then
    echo @ECHON@ "Testing script $i...@ECHOC@"
    rm -f $i.gp.c $i.gp.o $i.gp.so $i.gp $i.res start.gp
    cp "$testdir/gp/$i.gp" .
    if ../src/gp2c -p gp2c_ -g $i.gp >$i.gp.c 2>$i.res; then
      command=`echo "@PARI_MODULE_BUILD@" | sed -e s/%s/$i.gp/g`
      eval $command
      grep "^GP;" $i.gp.c | sed 's/^GP;//' >start.gp
      cat "$testdir/input/$i" >>start.gp
      '@GP_PATH@' -f -q -test <start.gp >$i.res 2>&1
      if test -f "$testdir/res/$i.res"; then 
        if diff "$testdir/res/$i.res" $i.res >/dev/null; then
          echo "@ECHOT@OK."
        else
          echo "@ECHOT@BUG."
          bugs=1;
        fi
      else
        test "$srcdir" = "." && cp $i.res "$testdir/res/$i.res"
        echo
        cat $i.res
      fi
    else
      echo "@ECHOT@BUG."
      bugs=1;
    fi
  fi
done
exit $bugs