~nataliabidart/ubuntu/natty/ubuntuone-control-panel/ubuntuone-control-panel-0.9.3

1 by Natalia Bidart (nessita)
Import upstream version 0.0.9
1
#! /bin/bash
2
#
3
# Author: Natalia Bidart <natalia.bidart@canonical.com>
4
#
5
# Copyright 2010 Canonical Ltd.
6
#
7
# This program is free software: you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License version 3, as published
9
# by the Free Software Foundation.
10
#
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranties of
13
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
# PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19
set -e
20
21
if [ $# -ne 0 ]; then
22
    # an extra argument was given
23
    if [ $1 == "--integration" ]; then
24
        # run only integration tests
25
        MODULE="ubuntuone/controlpanel/integrationtests"
26
    else
27
        if [ $1 == "--unittests" ]; then
28
            # run only non-integration tests (unittests)
29
            MODULE="ubuntuone/controlpanel/tests"
30
        else
31
            # run specific module given by the caller
32
            MODULE="$@"
33
        fi
34
    fi
35
else
36
    # run all tests, useful for tarmac and reviews
37
    MODULE="ubuntuone/controlpanel"
38
fi
39
40
style_check() {
41
    pylint ubuntuone/
42
    if [ -x `which pep8` ]; then
43
        pep8 --repeat ubuntuone/
44
    else
45
        echo "Please install the 'pep8' package."
46
    fi
47
}
48
49
echo "Running test suite for ""$MODULE"
50
`which xvfb-run` u1trial "$MODULE" && style_check
51
rm -rf _trial_temp