10 echo "$0: Unknown option '$1'"
14 GITBRANCH
=`git rev-parse --abbrev-ref HEAD`
15 REPORTDIR
=$PWD/..
/why3-reports-
$GITBRANCH
17 OUT
=$REPORTDIR/nightly-bench.out
18 PREVIOUS
=$REPORTDIR/nightly-bench.previous
19 DIFF
=$REPORTDIR/nightly-bench.
diff
20 REPORT
=$REPORTDIR/nightly-bench.report
22 if ! test -e "$REPORTDIR"; then
23 echo "directory '$REPORTDIR' for reports does not exist, creating."
28 LASTCOMMIT
=$REPORTDIR/lastcommit
30 DATE
=`date --utc +%Y-%m-%d`
31 SUBJECT
="Why3 [$GITBRANCH] bench : "
34 if test "$REPORTBYMAIL" == "no"; then
37 mail -s "$SUBJECT" $REPORTBYMAIL < $REPORT
42 LASTCOMMITHASH
=$
(cat $LASTCOMMIT 2>/dev
/null ||
echo 'none')
43 NEWCOMMITHASH
=$
(git rev-parse HEAD
)
45 if test $LASTCOMMITHASH = $NEWCOMMITHASH; then
46 echo "Not running nightly bench: last commit is the same as for previous run" > $REPORT
47 SUBJECT
="$SUBJECT not run (no new commit)"
49 echo "== Why3 bench on $DATE ==" > $REPORT
50 echo "Starting time (UTC): "`date --utc +%H:%M` >> $REPORT
51 echo "Current branch: "$GITBRANCH >> $REPORT
52 echo "Current commit: "$NEWCOMMITHASH >> $REPORT
56 .
/configure
--enable-local &> $OUT
57 if test "$?" != "0" ; then
58 echo "Configure failed" >> $REPORT
60 SUBJECT
="$SUBJECT configure failed"
63 echo "Configuration succeeded. " >> $REPORT
68 if test "$?" != "0" ; then
69 echo "Compilation failed" >> $REPORT
70 tail -20 $OUT >> $REPORT
71 SUBJECT
="$SUBJECT compilation failed"
74 echo "Compilation succeeded. " >> $REPORT
77 # detection of provers
78 bin
/why3 config detect
&> $OUT
79 if test "$?" != "0" ; then
80 echo "Prover detection failed" >> $REPORT
82 SUBJECT
="$SUBJECT prover detection failed"
85 echo "Prover detection succeeded. " >> $REPORT
88 # increase number of cores used
89 perl
-pi -e 's/running_provers_max = 2/running_provers_max = 4/' why3.conf
91 # add uninstalled prover substitution policies
93 COQVER
=$
(bin
/why3 config list-provers |
sed -n -e 's/Coq (\?\([0-9.]\+\).*/\1/p')
94 echo "Coq version detected: $COQVER" >> $REPORT
95 if test "$COQVER" != "" ; then
96 sed misc
/bench-coq-why3-conf
-e "s/@COQVER@/$COQVER/g" >> why3.conf
101 if test "$?" != "0" ; then
102 echo "Make bench FAILED" >> $REPORT
103 tail -20 $OUT >> $REPORT
104 SUBJECT
="$SUBJECT make bench failed,"
105 # we do not notify yet, we try the examples also
108 echo "Make bench succeeded. " >> $REPORT
111 # run regression bench for counterexamples
112 bench
/check-ce-bench
&> $OUT
113 if test "$?" != "0" ; then
114 echo "Counterexample regression tests FAILED" >> $REPORT
116 SUBJECT
="$SUBJECT (CE regression failed)"
118 echo "Counterexample regression tests succeeded. " >> $REPORT
122 examples
/regtests.sh
&> $OUT
123 if test "$?" != "0" ; then
124 SUBJECT
="$SUBJECT failed"
125 echo "Proof replay failed" >> $REPORT
127 SUBJECT
="$SUBJECT successful"
128 echo "REPLAY SUCCEEDED" >> $REPORT
131 # store the state for this day
132 cp $OUT $REPORTDIR/regtests-
$DATE
134 echo "Ending time (UTC): "`date --utc +%H:%M` >> $REPORT
138 tail -3 $OUT >> $REPORT
141 # output the diff against previous run
142 diff -u $PREVIOUS $OUT &> $DIFF
143 if test "$?" == 0 ; then
144 echo "---------- No difference with last bench ---------- " >> $REPORT
146 SUBJECT
="$SUBJECT (with new differences)"
147 if expr `cat $DIFF | wc -l` '>=' `cat $OUT | wc -l` ; then
148 echo "------- Diff with last bench is larger than the bench itself ------" >> $REPORT
150 echo "--------------- Diff with last bench --------------" >> $REPORT
152 sed '1,2d' $DIFF >> $REPORT
157 # finally print the full state
159 echo "-------------- Full current state --------------" >> $REPORT
163 echo $NEWCOMMITHASH > $LASTCOMMIT
165 fi # end of test if LASTCOMMITHASH = NEWCOMMITHASH
167 # final notification after the replay