unwanted commit
[oweals/gnunet.git] / contrib / revisionary.sh
1 #!/usr/local/bin/bash
2
3 STARTREVISION=14033
4 ENDREVISION=15268
5 CURRENTREVISION=$STARTREVISION 
6 HOME_DIR='/home/gnunet/FreeBSD7-AMD64-wachs/freebsd7-amd64-wachs/build'
7
8
9 CMD_UPDATE="svn up --force --accept theirs-full -r"
10 CMD_CLEANUP="killall -s 31 -r gnunet-*; make distclean;"
11 CMD_PREPARATION="./bootstrap; ./configure --prefix=/tmp/gnb --with-extractor=/usr/local"
12 CMD_BUILD="make all"
13 CMD_TEST="cd src/transport ; make test_transport_api_tcp; ./test_transport_api_tcp"
14
15 #LOGGING=""
16 LOGGING=" 1> /dev/null 2> errors.txt"
17 LOGFILE="log.txt"
18
19 function output ()
20 {
21   eval echo $1
22   eval echo $1 >> $LOGFILE
23 }
24
25
26 while [ $CURRENTREVISION -le $ENDREVISION ]; do
27   output 'Testing revision $CURRENTREVISION'
28 # updating
29   output ' -> updating '
30   eval cd $HOME_DIR
31   CMD="$CMD_UPDATE $CURRENTREVISION $LOGGING"
32   eval $CMD
33   result=$?
34   if [ $result -eq 0 ]; then
35     output "    updating OK"
36   else
37     output "    updating FAILED"
38     (( CURRENTREVISION++ )) 
39     continue
40   fi
41
42 # clean up
43   output " -> cleanup "
44   CMD="$CMD_CLEANUP $LOGGING"
45   eval $CMD
46   result=$?
47   if [ $result -eq 0 ]; then
48     output "    cleanup OK"
49   else
50     output "    cleanup FAILED"
51     (( CURRENTREVISION++ ))     
52     continue
53   fi
54 # preparing 
55   output " -> preparation "
56   CMD="$CMD_PREPARATION $LOGGING"
57   #echo $CMD
58   eval $CMD
59   result=$?
60   if [ $result -eq 0 ]; then
61     output "    preparation OK"
62   else
63     output "    preparation FAILED"
64     (( CURRENTREVISION++ )) 
65     continue
66   fi
67 # building
68   output  " -> building "
69   CMD="$CMD_BUILD $LOGGING"
70   #echo $CMD
71   eval $CMD
72   result=$?
73   if [ $result -eq 0 ]; then
74     output "    building OK"
75   else
76     output "    building FAILED"
77     (( CURRENTREVISION++ )) 
78     continue
79   fi
80 # testing
81   output " -> testing "
82   CMD="$CMD_TEST $LOGGING"
83   #echo $CMD
84   eval $CMD
85   result=$?
86   testresult=result
87   if [ $result -eq 0 ]; then
88     output "    testing OK"
89   else
90     output "    testing FAILED"
91     output 'Revision $CURRENTREVISION FAILED'
92   fi
93   (( CURRENTREVISION++ ))
94 done
95
96 exit
97
98