regtests.sh 1.13 KB
Newer Older
1 2 3
#!/bin/sh
# regression tests for why3

4 5 6 7 8 9 10 11 12 13 14 15
case "$1" in
  "-force")
        REPLAYOPT="-force"
        ;;
  "")
        REPLAYOPT=""
        ;;
  *)
        echo "$0: Unknown option '$1'"
        exit 2
esac

16
TMP=$PWD/why3regtests.out
17
TMPERR=$PWD/why3regtests.err
18

19
cd `dirname $0`
20

MARCHE Claude's avatar
MARCHE Claude committed
21
res=0
22 23

run_dir () {
24 25
    for f in `ls $1/*/why3session.xml`; do
        d=`dirname $f`
26
	echo -n "Replaying $d ... "
27
        ../bin/why3replayer.opt $REPLAYOPT $2 $d 2> $TMPERR > $TMP
28 29
        ret=$?
	if test "$ret" != "0"  ; then
30
	    echo -n "FAILED (ret code=$ret):"
31 32 33 34 35 36 37
            out=`head -1 $TMP`
            if test -z "$out" ; then
               echo "standard error: (standard output empty)"
               cat $TMPERR
            else
	       cat $TMP
            fi
MARCHE Claude's avatar
MARCHE Claude committed
38
	    res=1
39
	else
40 41
	    echo -n "OK"
	    cat $TMP
42 43 44 45
	fi
    done
}

46 47 48
echo "=== Logic ==="
run_dir .
echo ""
49

50 51 52
echo "=== BTS ==="
run_dir bts
echo ""
53

54 55 56
echo "=== Programs ==="
run_dir programs
echo ""
57

58 59
echo "=== Programs in their own subdir ==="
run_dir programs/vacid_0_binary_heaps "-I programs/vacid_0_binary_heaps"
60
echo ""
61

62 63 64
echo "=== Check Builtin translation ==="
run_dir check-builtin
echo ""
65

MARCHE Claude's avatar
MARCHE Claude committed
66 67
exit $res

68