]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/scripts/profile_svn.sh
fix
[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 -N software >> $SVNLOG 2>&1
48 cd software
49 svn update $SVNOPTIONS components >> $SVNLOG 2>&1
50 svn update $SVNOPTIONS matita >> $SVNLOG 2>&1
51 cd ..
52 cd ..
53 cd ..
54 ln -s trunk/helm .
55
56 #compile
57 export HOME="`pwd`/../$TMPDIRNAME.HOME"
58 compile $PWD/helm/software/
59
60 #run
61 run_tests $PWD/helm/software/matita > LOG 2>/dev/null
62
63 cat LOG | grep "\(OK\|FAIL\)" | grep "\(gc-on\|gc-off\)" | awk -f $PWD/helm/software/matita/scripts/insert.awk > INSERT.sql
64 cat INSERT.sql | mysql -u helm -h mowgli.cs.unibo.it matita
65 SVNREVISION=`cat $SVNLOG | grep revision | tail -n 1 | sed "s/.*revision \(\w\+\)./\1/"`
66 echo "INSERT INTO bench_svn VALUES ('$MARK','$SVNREVISION')" | mysql -u helm -h mowgli.cs.unibo.it matita
67 cd $OLD
68 #rm -rf $TMPDIRNAME