]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/scripts/profile_svn.sh
eca457ecc89f129980b2ab700da184c203c7d09e
[helm.git] / helm / matita / scripts / profile_svn.sh
1 #!/bin/bash
2 MARK=`date +%Y%m%d%H%M`
3 TMPDIRNAME=__${MARK}_compilation
4 SVNROOT="svn+ssh://mowgli.cs.unibo.it/local/svn/helm/trunk/"
5
6 function testit {
7   LOGTOOPT=/dev/null
8   LOGTOBYTE=/dev/null
9   export DO_TESTS_EXTRA="$MARK\t$@"
10   make tests DO_TESTS_OPTS="-no-color -twice -keep-logs"
11   make tests.opt DO_TESTS_OPTS="-no-color -twice -keep-logs"
12 }
13
14 function compile {
15   LOCALOLD=$PWD
16   cd $1
17   autoconf 1>/dev/null
18   ./configure 1>/dev/null
19   make all opt 1>/dev/null
20   cd $2
21   autoconf 1>/dev/null
22   ./configure 1>/dev/null
23   cp matita.conf.xml.sample matita.conf.xml
24   make all opt 1>/dev/null
25   cd $LOCALOLD
26 }
27
28 function run_tests {
29   LOCALOLD=$PWD
30   cd $1
31   ./matitaclean all
32   mkdir .matita
33   export OCAMLRUNPARAM='o=1000000'
34   testit "gc-off"
35   export OCAMLRUNPARAM=''
36   testit "gc-on"
37   cd $LOCALOLD
38 }
39
40 OLD=$PWD
41 rm -rf $TMPDIRNAME
42 mkdir $TMPDIRNAME
43 mkdir $TMPDIRNAME.HOME
44 cd $TMPDIRNAME
45 SVNLOG=`pwd`/LOG.svn
46
47 #svn
48 svn co -N $SVNROOT > $SVNLOG 2>&1
49 cd trunk 
50 svn update -N helm >> $SVNLOG 2>&1
51 cd helm
52 svn update $SVNOPTIONS ocaml >> $SVNLOG 2>&1
53 svn update $SVNOPTIONS matita >> $SVNLOG 2>&1
54 cd ..
55 cd ..
56 ln -s trunk/helm .
57
58 #compile
59 export HOME="`pwd`/../$TMPDIRNAME.HOME"
60 compile $PWD/helm/ocaml $PWD/helm/matita
61
62 #run
63 run_tests $PWD/helm/matita > LOG 2>/dev/null
64
65 cat LOG | grep "\(OK\|FAIL\)" | grep "\(gc-on\|gc-off\)" | awk -f $PWD/helm/matita/scripts/insert.awk > INSERT.sql
66 cat INSERT.sql | mysql -u helm -h mowgli.cs.unibo.it matita
67 SVNREVISION=`cat $SVNLOG | grep revision | tail -n 1 | sed "s/.*revision \(\w\+\)./\1/"`
68 echo "INSERT INTO bench_svn VALUES ('$MARK','$SVNREVISION')" | mysql -u helm -h mowgli.cs.unibo.it matita
69 cd $OLD
70 #rm -rf $TMPDIRNAME