Merge branch 'upgrade_proofs_coq_8_11_to_8_16' into 'master'
[why3.git] / bench / parsing-bench
blob2c18c95fba25789d140d294400ebe295bd7e0784
1 #!/bin/sh
3 # This checks specifically error messages
5 dir=`dirname $0`
7 updateoracle=false
8 files=""
10 while test $# != 0; do
11 case "$1" in
12 "-update-oracle")
13 updateoracle=true;;
14 "-"*)
15 printf "unknown option: %s\n" "$1"
16 printf "usage: parsing-bench [-update-oracle] <files>\n"
17 printf " <files> must be given without the '.mlw' suffix\n"
18 printf " if <files> empty, use all files from directory 'parsing/bad'\n"
19 exit 2;;
21 files="$files $1"
22 esac
23 shift
24 done
26 if test "$files" = "" ; then
27 files="$dir/parsing/bad/*.mlw"
30 run () {
31 printf " $1... "
32 f="$1"
33 $dir/../bin/why3.opt prove --parse-only "$1.mlw" 2> "$f.out"
34 if cmp "$f.oracle" "$f.out" > /dev/null 2>&1 ; then
35 echo "ok"
36 else
37 if $updateoracle; then
38 echo "Updating oracle for $1"
39 mv "$f.out" "$f.oracle"
40 else
41 echo "failed!"
42 echo "diff is the following:"
43 touch "$f.oracle"
44 diff -u "$f.oracle" "$f.out"
45 exit 1
50 for file in $files; do
51 filedir=`dirname $file`
52 filebase=`basename $file .mlw`
53 run $filedir/$filebase
54 done