5
5
# Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
7
XML_RESULTS="cppunitresults.xml"
14
SFLCONFDIR=${CONFIGDIR}/sflphone
16
function run_code_analysis {
17
# Check if cppcheck is installed on the system
18
if [ `which cppcheck &>/dev/null ; echo $?` -ne 1 ] ; then
20
cppcheck . --enable=all --xml --inline-suppr 2> cppcheck-report.xml
26
function gen_doxygen {
27
# Check if doxygen is installed on the system
28
if [ `which doxygen &>/dev/null ; echo $?` -ne 1 ] ; then
30
doxygen core-doc.cfg.in
36
function launch_unit_test_daemon {
37
# Run the unit tests for the daemon
39
# Remove the previous XML test file
41
./run_tests.sh || exit 1
46
function launch_functional_test_daemon {
47
# Run the python functional tests for the daemon
49
# make sure no other instance are currently running
53
# make sure the configuration directory created
55
SFLCONFDIR=${CONFDIR}/sflphone
57
eval `dbus-launch --auto-syntax`
59
if [ ! -d ${CONFDIR} ]; then
63
if [ ! -d ${SFLCONFDIR} ]; then
67
# make sure the most recent version of the configuration
69
pushd tools/pysflphone
70
cp -f sflphoned.functest.yml ${SFLCONFDIR}
73
# launch sflphone daemon, wait some time for
74
# dbus registration to complete
80
# launch the test script
81
pushd tools/pysflphone
82
nosetests --with-xunit test_sflphone_dbus_interface.py
87
function build_daemon {
90
# Run static analysis code tool
91
if [ $CODE_ANALYSIS == 1 ]; then
96
# Compile pjproject first
102
./configure --prefix=/usr
106
# Generate documentation
108
if [ $DOXYGEN == 1 ]; then
116
function build_gnome {
117
# Compile the plugins
121
./configure --prefix=/usr
129
./configure --prefix=/usr
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"
8
XML_RESULTS="cppunitresults.xml"
16
./configure --prefix=/usr
24
# Compile pjproject first
30
./configure --prefix=/usr
37
# Run the unit tests for the daemon
39
# Remove the previous XML test file
41
./run_tests.sh || exit 1
48
./configure --prefix=/usr
146
while getopts ":b: t a d" opt; do
149
echo "-b was triggered. Parameter: $OPTARG" >&2
153
echo "-t was triggered. Tests will be run" >&2
157
echo "-a was triggered. Static code analysis will be run" >&2
161
echo "-d was triggered. Doxygen documentation will be generated" >&2
165
echo "Invalid option: -$OPTARG" >&2
169
echo "Option -$OPTARG requires an argument." >&2
175
# Call appropriate build function, with parameters if needed
178
if [ $TEST == 1 ]; then
179
# launch_unit_test_daemon
180
launch_functional_test_daemon