Subversion Repositories HomeAutomation

Rev

Rev 960 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
806 eqlazer 1
#!/bin/bash
2
 
3
# Author Erik Larsson
4
# Date 2008-05-12
5
#
6
# This script builds default bios and if successful tries to build all the applications
7
 
830 arune 8
SCRIPTDIR=`dirname $0`
806 eqlazer 9
 
830 arune 10
source ${SCRIPTDIR}/settings.sh
806 eqlazer 11
 
813 eqlazer 12
# Put log in separate file
13
exec &> $LOGFILE
806 eqlazer 14
 
813 eqlazer 15
 
806 eqlazer 16
STARTDATE=`date`
17
echo "Starting $STARTDATE"
18
 
19
#Go to personal nodes
20
cd $PERSONALPATH
21
 
22
if test -e "$TESTNODE"
23
then
24
    echo "Directory already exist you fool"
25
    exit 0
26
fi
27
 
28
echo "Export template to testing node"
29
svn export template $TESTNODE
30
 
31
cd $TESTNODE
32
 
33
echo ""
34
echo "#######################################"
35
echo "Building BIOS"
36
echo "#######################################"
37
echo ""
38
 
39
if make bios
40
then
41
    echo ""
42
    echo "#######################################"
43
    echo "BIOS successful, continues with applications"
44
    echo "#######################################"
45
    echo ""
46
else
47
    echo ""
48
    echo "#######################################"
49
    echo "BIOS failed, stops testing"
50
    echo "#######################################"
51
    echo ""
52
 
53
    exit 0
54
fi
55
 
56
successful=() # Array for successful builds
57
failed=() # Array for failed builds
58
 
59
for testappl in $APPLPATH*
60
do
61
    echo; echo
62
 
808 eqlazer 63
    #with symlinks
809 eqlazer 64
    ln -s "$testappl" src
808 eqlazer 65
 
806 eqlazer 66
    echo ""
67
    echo "#######################################"
68
    echo "Building $testappl"
69
    echo "#######################################"
70
    echo ""
71
 
813 eqlazer 72
    #get svn info of the application
73
    cd src
74
    svn info
75
    cd ..
76
 
806 eqlazer 77
    # Build application
78
    if make
79
    then
80
        echo ""
81
        echo "#######################################"
82
        echo "$testappl successful, continues with next application"
83
        echo "#######################################"
84
        echo ""
85
 
86
        successfull=( "${successfull[@]}" "$testappl\n" )
87
 
88
    else
89
        echo ""
90
        echo "#######################################"
91
        echo "$testappl failed, continues with next application"
92
        echo "#######################################"
93
        echo ""
94
 
95
        failed=( "${failed[@]}" "$testappl\n" )
96
    fi
97
 
98
    make clean
809 eqlazer 99
    rm src
100
    rm config.inc
808 eqlazer 101
 
806 eqlazer 102
    continue # On to next application
103
  echo
104
done  
105
 
106
 
107
# Remove test node after finished building
108
cd ..
809 eqlazer 109
rm -r "$TESTNODE"
806 eqlazer 110
 
111
ENDDATE=`date`
112
 
113
echo ""
114
echo "#######################################"
115
echo "Results"
116
echo
117
echo "Started $STARTDATE"
118
echo "Finished $ENDDATE"
119
echo
120
echo "Successfull applications:"
121
echo  -e ${successfull[@]}
122
echo "Failed applications:"
123
echo -e ${failed[@]}
124
echo "#######################################"
125
echo ""
126
 
960 arune 127
#echo "Debug: DOPOSTIRC=$DOPOSTIRC failed=${#failed[@]} POSTLINE=$POSTLINE"
128
 
846 arune 129
if [ $DOPOSTIRC -eq "1" ] ; then
130
    if [ ${#failed[@]} -ne "0" ] ; then
960 arune 131
#echo "Debug: DOPOSTIRC=$DOPOSTIRC failed=${#failed[@]} POSTLINE=$POSTLINE"
132
        $POSTLINE \#hobby Tested to build apps, ${#failed[@]} failed, ${#successfull[@]} successfull, http://projekt.auml.se/homeautomation:software:embedded:last-build-test
1508 arune 133
        $POSTLINE2 Tested to build apps, ${#failed[@]} failed, ${#successfull[@]} successfull, http://projekt.auml.se/homeautomation:software:embedded:last-build-test
960 arune 134
#       $POSTLINE \#lekstuga Tested to build apps, failed ${#failed[@]}, successfull: ${#successfull[@]}, http://projekt.auml.se/homeautomation:software:embedded:last-build-test
135
#echo "POSTLINE exitcode: $?"
846 arune 136
    fi
137
fi
138
 
806 eqlazer 139
exit 0
140