]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/scripts/profile_svn.sh
9254544d5a389f93e6375d03e3580af845d33270
[helm.git] / helm / software / 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 $LOCALOLD
21 }
22
23 function run_tests {
24   LOCALOLD=$PWD
25   cd $1
26   ./matitaclean all
27   mkdir .matita
28   export OCAMLRUNPARAM='o=1000000'
29   testit "gc-off"
30   export OCAMLRUNPARAM=''
31   testit "gc-on"
32   cd $LOCALOLD
33 }
34
35 OLD=$PWD
36 rm -rf $TMPDIRNAME
37 mkdir $TMPDIRNAME
38 mkdir $TMPDIRNAME.HOME
39 cd $TMPDIRNAME
40 SVNLOG=`pwd`/LOG.svn
41
42 #svn
43 svn co -N $SVNROOT > $SVNLOG 2>&1
44 cd trunk 
45 svn update -N helm >> $SVNLOG 2>&1
46 cd helm
47 svn update $SVNOPTIONS software/components >> $SVNLOG 2>&1
48 svn update $SVNOPTIONS software/matita >> $SVNLOG 2>&1
49 cd ..
50 cd ..
51 ln -s trunk/helm .
52
53 #compile
54 export HOME="`pwd`/../$TMPDIRNAME.HOME"
55 compile $PWD/helm/
56
57 #run
58 run_tests $PWD/helm/software/matita > LOG 2>/dev/null
59
60 cat LOG | grep "\(OK\|FAIL\)" | grep "\(gc-on\|gc-off\)" | awk -f $PWD/helm/software/matita/scripts/insert.awk > INSERT.sql
61 cat INSERT.sql | mysql -u helm -h mowgli.cs.unibo.it matita
62 SVNREVISION=`cat $SVNLOG | grep revision | tail -n 1 | sed "s/.*revision \(\w\+\)./\1/"`
63 echo "INSERT INTO bench_svn VALUES ('$MARK','$SVNREVISION')" | mysql -u helm -h mowgli.cs.unibo.it matita
64 cd $OLD
65 #rm -rf $TMPDIRNAME