]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/scripts/crontab.sh
List.ma: added function nth (with default value in case of failure)
[helm.git] / matita / scripts / crontab.sh
index b3528cee6d3f811c702bd9f91f1b07f59af7b181..06cb81654aaa69600992ee60a636ee291be370be 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-set -x
+#set -x
 
 #configuration
 TODAY=`date +%Y%m%d`
@@ -15,7 +15,7 @@ SQLQMARK="select distinct mark from bench where mark like '%s%%' order by mark;"
 SQLQTIME="select SUM(timeuser) from bench where mark = '%s' group by mark;"
 SQLQFAILCOUNT="select count(distinct test) from bench where mark = '%s' and result = 'fail';"
 SQLQFAIL="select distinct test from bench where mark = '%s' and result = 'fail';"
-URL="http://mowgli.cs.unibo.it/~tassi/bench.php"
+URL="http://mowgli.cs.unibo.it/~sacerdot/bench.php"
 
 #initialization
 OLD=$PWD
@@ -65,15 +65,15 @@ fi
 if [ "$DELTA" -lt 0 ]; then
   PERC=0
 else
-  PREC=`lua50 scripts/functions.lua proportion $DELTA x $OLD_TIME 100`
+  PERC=`lua5.1 scripts/functions.lua proportion $DELTA x $OLD_TIME 100`
 fi
 if [ "$PERC" -ge 5 ]; then
   cat <<EOT
   
   Performance loss detected (MARK $MARK vs MARK $LASTMARK)
   
-  Is: `lua50 scripts/functions.lua t2s $CUR_TIME` 
-  Was: `lua50 scripts/functions.lua t2s $OLD_TIME`
+  Is: `lua5.1 scripts/functions.lua t2s $CUR_TIME` 
+  Was: `lua5.1 scripts/functions.lua t2s $OLD_TIME`
   
   For details: $URL
 EOT
@@ -84,21 +84,32 @@ CUR_FAIL=`printf "$SQLQFAILCOUNT" "$MARK" | $MYSQL | tail -n 1`
 OLD_FAIL=`printf "$SQLQFAILCOUNT" "$LASTMARK" | $MYSQL | tail -n 1`
 
 if [ "$CUR_FAIL" -gt "$OLD_FAIL" ]; then
+  TMP1=`mktemp`
+  TMP2=`mktemp`
+  TMP3=`mktemp`
+  printf "$SQLQFAIL" "$MARK" | $MYSQL > $TMP1
+  printf "$SQLQFAIL" "$LASTMARK" | $MYSQL > $TMP2
+  combine $TMP1 not $TMP2 > $TMP3
+
   cat <<EOT
 
   More broken tests detected (MARK $MARK vs MARK $LASTMARK)
   Is: $CUR_FAIL
   Was: $OLD_FAIL 
-  
-  Now broken:
-`printf "$SQLQFAIL" "$MARK" | $MYSQL`
 
-  Were broken:
-`printf "$SQLQFAIL" "$LASTMARK" | $MYSQL`
+  Tests that are broken in $MARK but where not broken in $LASTMARK:
+`cat $TMP3`
+
+  List of broken tests in mark $MARK: 
+`cat $TMP1`
+
+  List of broken tests in old mark $LASTMARK:
+`cat $TMP2`
   
   For details: $URL
 EOT
 
+  rm $TMP1 $TMP2 $TMP3
 fi
 
 cd $OLD