2
# This file is part of Checkbox.
4
# Copyright 2013 Canonical Ltd.
6
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
8
# Checkbox is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation, either version 3 of the License, or
11
# (at your option) any later version.
13
# Checkbox is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
21
# Helper script to run coverage testing
22
# =====================================
24
# XXX: Requires activated virtualenv with coverage
25
# It *may* work in other situations so this is not enforced
27
# Disable all kinds of locale support
32
# On recent enough Debian/Ubuntu you can run this with python3-coverage (or
33
# python3.4-coverage) to run coverage with standard packages, without
34
# virtualenv. Everywhere else the default 'coverage3' should work fine.
36
# Because python3-coverage is still broken
37
coverage=${1:-coverage3}
39
# Run plainbox self-test, pass --after-reexec to fake the internal re-exec that
40
# it performs (this seems to fail when invoked this way as it assumes it knows
41
# to run plainbox self-test which we are not doing here)
42
$coverage run --branch --module plainbox self-test \
48
# Run integrations tests as well, unless --skip-integration
49
if [ "$1" != "--skip-integration" ]; then
50
$coverage run --append --branch $(which plainbox) self-test \
57
# Display the non-html report
60
# Generate the HTML report
63
echo "The HTML report is now ready in htmlcov"