]> matita.cs.unibo.it Git - helm.git/blob - matita/scripts/profile_svn.sh
tagged 0.5.0-rc1
[helm.git] / matita / scripts / profile_svn.sh
1 #!/bin/bash
2
3 #configuration
4 MARK=`date +%Y%m%d%H%M`
5 TMPDIRNAME=__${MARK}_compilation
6 SVNROOT="svn+ssh://mowgli.cs.unibo.it/local/svn/helm/trunk/"
7 MYSQL="mysql -u helm -h mowgli.cs.unibo.it matita"
8 SVNLOG=LOG.svn
9
10 #helpers
11 function testit {
12   LOGTOOPT=/dev/null
13   LOGTOBYTE=/dev/null
14   export BENCH_EXTRA_TEXT="$MARK $@"
15   make tests.opt 
16   make tests 
17 }
18
19 function compile {
20   LOCALOLD=$PWD
21   cd $1
22   autoconf 1>/dev/null
23   ./configure 1>/dev/null
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   #export OCAMLRUNPARAM='o=100000'
33   #testit "gc-off"
34   export OCAMLRUNPARAM=''
35   testit "gc-on"
36   cd $LOCALOLD
37 }
38
39 #initialization
40 OLD=$PWD
41 rm -rf $TMPDIRNAME
42 mkdir $TMPDIRNAME
43 mkdir $TMPDIRNAME.HOME
44 cd $TMPDIRNAME
45
46 #svn checkout
47 svn co -N $SVNROOT > $SVNLOG 2>&1
48 cd trunk 
49 svn update -N helm >> $SVNLOG 2>&1
50 cd helm
51 svn update -N software >> $SVNLOG 2>&1
52 cd software
53 svn update $SVNOPTIONS components >> $SVNLOG 2>&1
54 svn update $SVNOPTIONS matita >> $SVNLOG 2>&1
55 cd ..
56 cd ..
57 cd ..
58 ln -s trunk/helm .
59
60 #compile
61 export HOME="`pwd`/../$TMPDIRNAME.HOME"
62 export USER="bench"
63 compile $PWD/helm/software/
64
65 #run
66 run_tests $PWD/helm/software/matita > LOG 2>LOG.run_tests.err
67
68 #insert the db
69 cat LOG | grep "\(OK\|FAIL\)" | grep "\(gc-on\|gc-off\)" | grep -v "bad_tests" | grep -v "interactive" |\
70   lua5.1 $PWD/helm/software/matita/scripts/functions.lua log2sql - > INSERT.sql
71 cat INSERT.sql | $MYSQL
72
73 #save the revision
74 SVNREVISION=`svn info $PWD/helm/software/ | grep "^Revision:" | cut -d : -f 2`
75 echo "INSERT INTO bench_svn VALUES ('$MARK','$SVNREVISION')" | $MYSQL
76 cd $OLD
77 #rm -rf $TMPDIRNAME
78
79 #eof