~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to hudson-sflphone-script.sh

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2012-05-19 21:46:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120519214637-la8rbrford5kj6m3
Tags: 1.1.0-1
* New upstream release 
  - Fixes "FTBFS with libccrtp-dev/2.0.2 from experimental" (Closes: #663282)
* NEW Maintainer: Debian VoIP Team - Thanks Francois for your work.
  - (Closes: #665789: O: sflphone -- SIP and IAX2 compatible VoIP phone)
* Added Build-Depends: libdbus-c++-bin
* Add gcc47-fixes.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#
5
5
# Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
6
6
 
 
7
XML_RESULTS="cppunitresults.xml"
 
8
TEST=0
 
9
BUILD=
 
10
CODE_ANALYSIS=0
 
11
DOXYGEN=0
 
12
 
 
13
CONFIGDIR=~/.config
 
14
SFLCONFDIR=${CONFIGDIR}/sflphone
 
15
 
 
16
function run_code_analysis {
 
17
        # Check if cppcheck is installed on the system
 
18
        if [ `which cppcheck &>/dev/null ; echo $?` -ne 1 ] ; then
 
19
                pushd src
 
20
                cppcheck . --enable=all --xml --inline-suppr 2> cppcheck-report.xml
 
21
                popd
 
22
        fi
 
23
}
 
24
 
 
25
 
 
26
function gen_doxygen {
 
27
        # Check if doxygen is installed on the system
 
28
        if [ `which doxygen &>/dev/null ; echo $?` -ne 1 ] ; then
 
29
                pushd doc/doxygen
 
30
                doxygen core-doc.cfg.in
 
31
                popd
 
32
        fi
 
33
}
 
34
 
 
35
 
 
36
function launch_unit_test_daemon {
 
37
        # Run the unit tests for the daemon
 
38
        pushd daemon/test
 
39
        # Remove the previous XML test file
 
40
        rm -rf $XML_RESULTS
 
41
        ./run_tests.sh || exit 1
 
42
        popd
 
43
}
 
44
 
 
45
 
 
46
function launch_functional_test_daemon {
 
47
        # Run the python functional tests for the daemon
 
48
 
 
49
        # make sure no other instance are currently running
 
50
        killall sflphoned
 
51
        killall sipp
 
52
 
 
53
        # make sure the configuration directory created
 
54
        CONFDIR=~/.config
 
55
        SFLCONFDIR=${CONFDIR}/sflphone
 
56
 
 
57
        eval `dbus-launch --auto-syntax`
 
58
 
 
59
        if [ ! -d ${CONFDIR} ]; then
 
60
            mkdir ${CONFDIR}
 
61
        fi
 
62
 
 
63
        if [ ! -d ${SFLCONFDIR} ]; then
 
64
            mkdir ${SFLCONFDIR}
 
65
        fi
 
66
 
 
67
        # make sure the most recent version of the configuration
 
68
        # is installed
 
69
        pushd tools/pysflphone
 
70
            cp -f sflphoned.functest.yml ${SFLCONFDIR}
 
71
        popd
 
72
 
 
73
        # launch sflphone daemon, wait some time for
 
74
        # dbus registration to complete
 
75
        pushd daemon
 
76
            ./src/sflphoned &
 
77
            sleep 3
 
78
        popd
 
79
 
 
80
        # launch the test script
 
81
        pushd tools/pysflphone
 
82
            nosetests --with-xunit test_sflphone_dbus_interface.py
 
83
        popd
 
84
}
 
85
 
 
86
 
 
87
function build_daemon {
 
88
        # Compile the daemon
 
89
        pushd daemon
 
90
        # Run static analysis code tool
 
91
        if [ $CODE_ANALYSIS == 1 ]; then
 
92
                run_code_analysis
 
93
        fi
 
94
        make distclean
 
95
        ./autogen.sh
 
96
        # Compile pjproject first
 
97
        pushd libs/pjproject
 
98
        ./autogen.sh
 
99
        ./configure
 
100
        make && make dep
 
101
        popd
 
102
        ./configure --prefix=/usr
 
103
        make clean
 
104
        # Compile src code
 
105
        make -j
 
106
        # Generate documentation
 
107
        make doc
 
108
        if [ $DOXYGEN == 1 ]; then
 
109
                gen_doxygen
 
110
        fi
 
111
        # Compile unit tests
 
112
        make check
 
113
        popd
 
114
}
 
115
 
 
116
function build_gnome {
 
117
        # Compile the plugins
 
118
        pushd plugins
 
119
        make distclean
 
120
        ./autogen.sh
 
121
        ./configure --prefix=/usr
 
122
        make -j
 
123
        popd
 
124
 
 
125
        # Compile the client
 
126
        pushd gnome
 
127
        make distclean
 
128
        ./autogen.sh
 
129
        ./configure --prefix=/usr
 
130
        make clean
 
131
        make -j 1
 
132
        make check
 
133
        popd
 
134
}
 
135
 
 
136
 
 
137
if [ "$#" -eq 0 ]; then   # Script needs at least one command-line argument.
 
138
        echo "Usage $0 -b select which one to build: daemon or gnome
 
139
                                  -t enable unit tests after build"
 
140
        exit $E_OPTERR
 
141
fi
 
142
 
 
143
 
7
144
git clean -f -d -x
8
 
XML_RESULTS="cppunitresults.xml"
9
 
 
10
 
set -x
11
 
 
12
 
# Compile the plugins
13
 
pushd plugins
14
 
make distclean
15
 
./autogen.sh
16
 
./configure --prefix=/usr
17
 
make -j
18
 
popd
19
 
 
20
 
# Compile the daemon
21
 
pushd daemon
22
 
make distclean
23
 
./autogen.sh
24
 
# Compile pjproject first
25
 
pushd libs/pjproject
26
 
./autogen.sh
27
 
./configure
28
 
make && make dep
29
 
popd
30
 
./configure --prefix=/usr
31
 
make clean
32
 
make -j
33
 
make doc
34
 
make check
35
 
popd
36
 
 
37
 
# Run the unit tests for the daemon
38
 
pushd daemon/test
39
 
# Remove the previous XML test file
40
 
rm -rf $XML_RESULTS
41
 
./run_tests.sh || exit 1
42
 
popd
43
 
 
44
 
# Compile the client
45
 
pushd gnome
46
 
make distclean
47
 
./autogen.sh
48
 
./configure --prefix=/usr
49
 
make clean
50
 
make -j 1
51
 
make check
52
 
popd
 
145
 
 
146
while getopts ":b: t a d" opt; do
 
147
        case $opt in
 
148
                b)
 
149
                        echo "-b was triggered. Parameter: $OPTARG" >&2
 
150
                        BUILD=$OPTARG
 
151
                        ;;
 
152
                t)
 
153
                        echo "-t was triggered. Tests will be run" >&2
 
154
                        TEST=1
 
155
                        ;;
 
156
                a)
 
157
                        echo "-a was triggered. Static code analysis will be run" >&2
 
158
                        CODE_ANALYSIS=1
 
159
                        ;;
 
160
                d)
 
161
                        echo "-d was triggered. Doxygen documentation will be generated" >&2
 
162
                        DOXYGEN=1
 
163
                        ;;
 
164
                \?)
 
165
                        echo "Invalid option: -$OPTARG" >&2
 
166
                        exit 1
 
167
                        ;;
 
168
                :)
 
169
                        echo "Option -$OPTARG requires an argument." >&2
 
170
                        exit 1
 
171
                        ;;
 
172
                esac
 
173
done
 
174
 
 
175
# Call appropriate build function, with parameters if needed
 
176
build_$BUILD
 
177
 
 
178
if [ $TEST == 1 ]; then
 
179
    # launch_unit_test_daemon
 
180
    launch_functional_test_daemon
 
181
fi
53
182
 
54
183
# SUCCESS
55
184
exit 0