]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/scripts/profile_svn.sh
2527d920304d6b854f4e02c7f88697f7156e966e
[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
46 #svn
47 svn co -N $SVNROOT > LOG.svn 2>&1
48 cd trunk 
49 svn update -N helm >> LOG.svn 2>&1
50 cd helm
51 svn update ocaml >> LOG.svn 2>&1
52 svn update matita >> LOG.svn 2>&1
53 cd ..
54 cd ..
55 ln -s trunk/helm .
56
57 #compile
58 export HOME="`pwd`/../$TMPDIRNAME.HOME"
59 compile $PWD/helm/ocaml $PWD/helm/matita
60
61 #run
62 run_tests $PWD/helm/matita > LOG 2>/dev/null
63
64 cat LOG | grep "\(OK\|FAIL\)" | grep "\(gc-on\|gc-off\)" | awk -f $PWD/helm/matita/scripts/insert.awk > INSERT.sql
65 cat INSERT.sql | mysql -u helm -h mowgli.cs.unibo.it matita
66 cd $OLD
67 #rm -rf $TMPDIRNAME