summaryrefslogtreecommitdiff
path: root/contrib/scripts/revisionary.sh
blob: a39660d52d5dea167c60de23d42b8eca5eb7c2f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/usr/local/bin/bash

STARTREVISION=14033
ENDREVISION=15268
CURRENTREVISION=$STARTREVISION 
HOME_DIR='/home/gnunet/FreeBSD7-AMD64-wachs/freebsd7-amd64-wachs/build'


CMD_UPDATE="svn up --force --accept theirs-full -r"
CMD_CLEANUP="killall -s 31 -r gnunet-*; make distclean;"
CMD_PREPARATION="./bootstrap; ./configure --prefix=/tmp/gnb --with-extractor=/usr/local"
CMD_BUILD="make all"
CMD_TEST="cd src/transport ; make test_transport_api_tcp; ./test_transport_api_tcp"

#LOGGING=""
LOGGING=" 1> /dev/null 2> errors.txt"
LOGFILE="log.txt"

output ()
{
  eval echo $1
  eval echo $1 >> $LOGFILE
}


while [ $CURRENTREVISION -le $ENDREVISION ]; do
  output 'Testing revision $CURRENTREVISION'
# updating
  output ' -> updating '
  eval cd $HOME_DIR
  CMD="$CMD_UPDATE $CURRENTREVISION $LOGGING"
  eval $CMD
  result=$?
  if [ $result -eq 0 ]; then
    output "    updating OK"
  else
    output "    updating FAILED"
    (( CURRENTREVISION++ )) 
    continue
  fi

# clean up
  output " -> cleanup "
  CMD="$CMD_CLEANUP $LOGGING"
  eval $CMD
  result=$?
  if [ $result -eq 0 ]; then
    output "    cleanup OK"
  else
    output "    cleanup FAILED"
    (( CURRENTREVISION++ ))     
    continue
  fi
# preparing 
  output " -> preparation "
  CMD="$CMD_PREPARATION $LOGGING"
  #echo $CMD
  eval $CMD
  result=$?
  if [ $result -eq 0 ]; then
    output "    preparation OK"
  else
    output "    preparation FAILED"
    (( CURRENTREVISION++ )) 
    continue
  fi
# building
  output  " -> building "
  CMD="$CMD_BUILD $LOGGING"
  #echo $CMD
  eval $CMD
  result=$?
  if [ $result -eq 0 ]; then
    output "    building OK"
  else
    output "    building FAILED"
    (( CURRENTREVISION++ )) 
    continue
  fi
# testing
  output " -> testing "
  CMD="$CMD_TEST $LOGGING"
  #echo $CMD
  eval $CMD
  result=$?
  testresult=result
  if [ $result -eq 0 ]; then
    output "    testing OK"
  else
    output "    testing FAILED"
    output 'Revision $CURRENTREVISION FAILED'
  fi
  (( CURRENTREVISION++ ))
done

exit