Task: task_hd_equal and task_equal compare the goals structurally
[why3.git] / bench / parsing-bench
blobe4f2cbce5d1f34da97d8d93d81d661cfdac1fdba
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/why3prove.opt --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"
49 for file in $files; do
50 filedir=`dirname $file`
51 filebase=`basename $file .mlw`
52 printf "Parsing files\n";
53 run $filedir/$filebase
54 done