regtests.sh 1.5 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

21 22
# too early to do that
# REPLAYOPT="$REPLAYOPT -smoke-detector top"
23

MARCHE Claude's avatar
MARCHE Claude committed
24
res=0
25 26
export success=0
export total=0
27 28

run_dir () {
29 30
    for f in `ls $1/*/why3session.xml`; do
        d=`dirname $f`
31
	echo -n "Replaying $d ... "
32
        ../bin/why3replayer.opt $REPLAYOPT $2 $d 2> $TMPERR > $TMP
33 34
        ret=$?
	if test "$ret" != "0"  ; then
35
	    echo -n "FAILED (ret code=$ret):"
36 37 38 39 40 41 42
            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
43
	    res=1
44
	else
45 46
	    echo -n "OK"
	    cat $TMP
47
            success=`expr $success + 1`
48
	fi
49
        total=`expr $total + 1`
50 51 52
    done
}

53

54 55 56
echo "=== Logic ==="
run_dir .
echo ""
57

58 59 60 61 62 63 64 65
echo "=== Tests Provers ==="
run_dir tests-provers
echo ""

echo "=== Check Builtin translation ==="
run_dir check-builtin
echo ""

66 67 68
echo "=== BTS ==="
run_dir bts
echo ""
69

70 71 72
echo "=== Programs ==="
run_dir programs
echo ""
73

74 75
echo "=== Programs in their own subdir ==="
run_dir programs/vacid_0_binary_heaps "-I programs/vacid_0_binary_heaps"
MARCHE Claude's avatar
MARCHE Claude committed
76
run_dir hoare_logic "-I hoare_logic"
77
run_dir bitvectors "-I bitvectors"
78
run_dir foveoos2011 "-I foveoos2011"
79
echo ""
80

81
echo "Summary: $success/$total"
MARCHE Claude's avatar
MARCHE Claude committed
82 83
exit $res

84

85