3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#!/bin/bash
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Run continuous integration tests.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Copyright (C) 2014 Red Hat
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# This program is free software; you can redistribute it and/or modify
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# it under the terms of the GNU General Public License as published by
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# the Free Software Foundation; either version 3 of the License, or
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# (at your option) any later version.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# This program is distributed in the hope that it will be useful,
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# but WITHOUT ANY WARRANTY; without even the implied warranty of
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# GNU General Public License for more details.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# You should have received a copy of the GNU General Public License
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# along with this program. If not, see <http://www.gnu.org/licenses/>.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovset -o nounset -o pipefail -o errexit
6398f22526303343193a18e514602f1af6fb29cbNikolai Kondrashovdeclare -r CI_DIR=`dirname "\`readlink -f \"\$0\"\`"`
6398f22526303343193a18e514602f1af6fb29cbNikolai Kondrashovexport PATH=$CI_DIR:$PATH
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovexport LC_ALL=C
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov. deps.sh
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov. distro.sh
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov. configure.sh
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov. misc.sh
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r DEBUG_CFLAGS="-g3 -O2"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r COVERAGE_CFLAGS="-g3 -O0 --coverage"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r ARCH=`uname -m`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r CPU_NUM=`getconf _NPROCESSORS_ONLN`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r TITLE_WIDTH=24
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r RESULT_WIDTH=18
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Minimum percentage of code lines covered by tests
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r COVERAGE_MIN_LINES=15
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Minimum percentage of code functions covered by tests
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare -r COVERAGE_MIN_FUNCS=0
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# Those values are a sum up of the default warnings in all our
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# supported distros in our CI.
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# debian_testing: E121,E123,E126,E226,E24,E704,W503
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# fedora22:
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# fedora23:
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# fedora24: E121,E123,E126,E226,E24,E704
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# fedora25: E121,E123,E126,E226,E24,E704
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# fedora26: E121,E123,E126,E226,E24,E704
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# fedora27: E121,E123,E126,E226,E24,E704
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# fedora_rawhide: E121,E123,E126,E226,E24,E704
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# rhel6:
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio# rhel7:
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidênciodeclare PEP8_IGNORE="--ignore=E121,E123,E126,E226,E24,E704,W503"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare BASE_PFX=""
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare DEPS=true
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare BASE_DIR=`pwd`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare MODERATE=false
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare RIGOROUS=false
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Output program usage information.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction usage()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov cat <<EOF
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovUsage: `basename "$0"` [OPTION...]
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovRun continuous integration tests.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovOptions:
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -h, --help Output this help message and exit.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -p, --prefix=STRING Use STRING as the prefix to prepend to file and
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov directory paths in output.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -n, --no-deps Don't attempt to install dependencies.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -e, --essential Run the essential subset of tests.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -m, --moderate Run the moderate subset of tests.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -r, --rigorous,
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -f, --full Run the rigorous (full) set of tests.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovDefault options: --essential
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai KondrashovEOF
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Output a file display path: a path relocated from base directory (BASE_DIR)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# to base prefix (BASE_PFX).
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Args: path
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction disppath()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare -r path=`readlink -f "$1"`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "%s" "$BASE_PFX${path:${#BASE_DIR}+1}"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Run a stage.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Args: id cmd [arg...]
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction stage()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare -r id="$1"; shift
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare -r log="ci-$id.log"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare status
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare start
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare end
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare duration
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "%-${TITLE_WIDTH}s" "$id:"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov {
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "Start: "
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov start=`date +%s`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov date --date="@$start"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov set +o errexit
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov (
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov set -o errexit -o xtrace
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "$@"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov )
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov status=$?
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov set -o errexit
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "End: "
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov end=`date +%s`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov date --date="@$end"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov } &> "$log"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov duration=$((end - start))
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov if [ "$status" == 0 ]; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf 'success '
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov else
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf 'failure '
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov fi
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "%02u:%02u:%02u " \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov $((duration / (60 * 60))) \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov $((duration / 60 % 60)) \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov $((duration % 60))
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov disppath "$log"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "\n"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov return "$status"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Execute mock as is, or, if the user is not in the "mock" group, under sudo,
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# which has password prompt/input on the console, instead of stderr/stdin.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Args: [mock_arg...]
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction mock_privileged()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov if memberof mock; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov mock "$@"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov else
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare prompt=$'Not a "mock" group member.\n'
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov prompt+="To run mock enter sudo password for $USER: "
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov sudo -p "$prompt" mock "$@"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov fi
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Execute mock_privileged with extra chroot configuration added.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Args: chroot [mock_arg...]
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Input: extra configuration
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction mock_privileged_conf()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare -r chroot="$1"; shift
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare conf_dir
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov conf_dir=`mktemp --tmpdir --directory mock-config.XXXXXXXX`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov trap 'trap - RETURN; rm -R "$conf_dir";' RETURN
8ef1a136c1406bd1bab66e4ebf75b9375090cd86Nikolai Kondrashov # Preserve timestamps to avoid unnecessary cache rebuilds
8ef1a136c1406bd1bab66e4ebf75b9375090cd86Nikolai Kondrashov cp -r --preserve=timestamps /etc/mock/* "$conf_dir"/
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov cat >> "${conf_dir}/${chroot}.cfg"
8ef1a136c1406bd1bab66e4ebf75b9375090cd86Nikolai Kondrashov touch --reference="/etc/mock/${chroot}.cfg" "${conf_dir}/${chroot}.cfg"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov mock_privileged --configdir="$conf_dir" --root="$chroot" "$@"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Execute mock_privileged with dependency package source configuration added.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Args: chroot [mock_arg...]
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction mock_privileged_deps()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3e2f89726a90dfe091d7d7d3b558d97469e5d3afLukas Slebodnik declare -r chroot_name="$1"; shift
3e2f89726a90dfe091d7d7d3b558d97469e5d3afLukas Slebodnik declare -r config=$(basename $(readlink -f "/etc/mock/${chroot_name}.cfg"))
3e2f89726a90dfe091d7d7d3b558d97469e5d3afLukas Slebodnik declare -r chroot="${config%.cfg}"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare repo
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov if [[ "$chroot" == fedora-* ]]; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov repo='fedora-$releasever-$basearch'
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov elif [[ "$chroot" =~ epel-([0-9]+) ]]; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov repo="epel-${BASH_REMATCH[1]}-\$basearch"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov else
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov echo "Unknown chroot config: $chroot" >&2
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov exit 1
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov fi
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov mock_privileged_conf "$chroot" "$@" <<<"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovconfig_opts['yum.conf'] += '''
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov[sssd-deps]
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovname=Extra SSSD dependencies
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovbaseurl=http://copr-be.cloud.fedoraproject.org/results/lslebodn/sssd-deps/$repo/
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovskip_if_unavailable=true
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovgpgcheck=0
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovenabled=1
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov'''
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Run debug build checks.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction build_debug()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
8dff4a773dd9525ec587cd31646a9f67252122c1Nikolai Kondrashov # Extended glob pattern matching tests to run under Valgrind.
8dff4a773dd9525ec587cd31646a9f67252122c1Nikolai Kondrashov # NOTE: The particular pattern below is inverted
bc85b85227b87758d80e84b30e4823370d5ffca7Lukas Slebodnik declare valgrind_test_pattern="!(*.py|*/whitespace_test|"
bc85b85227b87758d80e84b30e4823370d5ffca7Lukas Slebodnik declare -r valgrind_test_pattern+="*/double_semicolon_test)"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov export CFLAGS="$DEBUG_CFLAGS"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare test_dir
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare test_dir_distcheck
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov declare intgcheck_configure_args
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare distcheck_configure_args
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare status
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage configure "$BASE_DIR/configure" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "${CONFIGURE_ARG_LIST[@]}" \
7c0402b85627587bcac004d4bfdbf181bbae8549Lukas Slebodnik --with-test-dir="$test_dir"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik stage make-tests make -j $CPU_NUM check LOG_COMPILER=true
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov status=0
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov CK_FORK=no \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage make-check-valgrind \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik make -j $CPU_NUM check \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik LOG_COMPILER=libtool \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik LOG_FLAGS="--mode=execute \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik valgrind-condense 99 \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik \"$valgrind_test_pattern\" -- \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik --trace-children=yes \
223f4ff3cd9136414a8b593587f5742bf2c914cdLukas Slebodnik --trace-children-skip='*/bin/*,*/sbin/*,./dummy-child' \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik --leak-check=full \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik --gen-suppressions=all \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik --suppressions=\"$CI_DIR/sssd.supp\" \
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik --verbose" ||
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov status=$?
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov mv "$test_dir" ci-test-dir
b7a17cb7d498ce6f1f8b385ae2c442c6a19a8986Nikolai Kondrashov ((status == 0))
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov if "$MODERATE"; then
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov if "$DEPS_INTGCHECK_SATISFIED"; then
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov printf -v intgcheck_configure_args " %q" \
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov "${CONFIGURE_ARG_LIST[@]}"
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov stage make-intgcheck make -j $CPU_NUM intgcheck \
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov INTGCHECK_CONFIGURE_FLAGS=" \
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov $intgcheck_configure_args"
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov fi
9d453f1e8b28983b363b44c49b7cd701a994fd97Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov test_dir_distcheck=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov # Single thread due to https://fedorahosted.org/sssd/ticket/2354
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov status=0
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf -v distcheck_configure_args " %q" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "${CONFIGURE_ARG_LIST[@]}" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "--with-test-dir=$test_dir_distcheck"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage make-distcheck make distcheck \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov AUX_DISTCHECK_CONFIGURE_FLAGS=" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov $distcheck_configure_args" ||
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov status=$?
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov mv "$test_dir_distcheck" ci-test-dir-distcheck
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov ((status == 0))
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov if [[ "$DISTRO_BRANCH" == -redhat-* ]]; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage make-srpm env -u CFLAGS -- make srpm
3e2f89726a90dfe091d7d7d3b558d97469e5d3afLukas Slebodnik stage mock-build mock_privileged_deps "default" \
3e2f89726a90dfe091d7d7d3b558d97469e5d3afLukas Slebodnik --resultdir ci-mock-result \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov rpmbuild/SRPMS/*.src.rpm
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov fi
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov fi
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov unset CFLAGS
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Run coverage build checks.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction build_coverage()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare -r coverage_report_dir="ci-report-coverage"
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik declare extra_CFLAGS=""
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare test_dir
8d1b572126afceb60693ff4c4a734bd6dbdaf548Nikolai Kondrashov declare status
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik if [[ "$DISTRO_BRANCH" == -redhat-redhatenterprise*-6.*- ||
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik "$DISTRO_BRANCH" == -redhat-centos-6.*- ]]; then
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik # enable optimisation to avoid bug in gcc < 4.6.0
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik # gcc commit 7959b7e646b493f48a2ea7228fbf1c43f84bedea
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik # git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162384
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik # 138bc75d-0d04-0410-961f-82ee72b054a4
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik extra_CFLAGS=" -O1"
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik fi
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik
057f699b401097ad7f48fe3760e81c6993619a4bLukas Slebodnik export CFLAGS="$COVERAGE_CFLAGS $extra_CFLAGS"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov test_dir=`mktemp --directory /dev/shm/ci-test-dir.XXXXXXXX`
e373fffbb8e06d0d7682d095c734e8df8a499ba0Nikolai Kondrashov stage configure "$BASE_DIR/configure" \
e373fffbb8e06d0d7682d095c734e8df8a499ba0Nikolai Kondrashov "${CONFIGURE_ARG_LIST[@]}" \
e373fffbb8e06d0d7682d095c734e8df8a499ba0Nikolai Kondrashov --with-test-dir="$test_dir"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov # Build everything, including tests
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov # Not building "tests" due to https://fedorahosted.org/sssd/ticket/2350
444a82bd6d68c6f23e05d523ff92d328f6b2ec05Lukas Slebodnik stage make-tests make -j $CPU_NUM check LOG_COMPILER=true
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage lcov-pre lcov --capture --initial --directory . \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --base-directory "$BASE_DIR" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --output-file ci-base.info
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov # Run tests
8d1b572126afceb60693ff4c4a734bd6dbdaf548Nikolai Kondrashov status=$?
8d1b572126afceb60693ff4c4a734bd6dbdaf548Nikolai Kondrashov stage make-check make -j $CPU_NUM check || status=$?
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov mv "$test_dir" ci-test-dir
8d1b572126afceb60693ff4c4a734bd6dbdaf548Nikolai Kondrashov ((status == 0))
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage lcov-post lcov --capture --directory . \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --base-directory "$BASE_DIR" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --output-file ci-check.info
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage lcov-merge lcov --add-tracefile ci-base.info \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --add-tracefile ci-check.info \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --output-file ci-dirty.info
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage lcov-clean lcov --remove ci-dirty.info \
94b860e8fc51c659c6ac09d69481b838555fff76Lukas Slebodnik "/usr/*" "src/tests/*" "/tmp/*" \
0a20e4c033edfd8eb8e0683b77d23fadfb6565fbLukas Slebodnik "*dtrace-temp.c" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --output-file ci.info
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage genhtml eval 'genhtml --output-directory \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "$coverage_report_dir" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --title "sssd" --show-details \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --legend --prefix "$BASE_DIR" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov ci.info |& tee ci-genhtml.out'
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "%-$((TITLE_WIDTH + RESULT_WIDTH))s%s\n" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "coverage report:" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "`disppath \"\$coverage_report_dir/index.html\"`"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
933c7c5efc76b4a9f3206b36bf6fe60e5dd635f1Nikolai Kondrashov stage lcov-check eval 'lcov_check "$COVERAGE_MIN_LINES" \
933c7c5efc76b4a9f3206b36bf6fe60e5dd635f1Nikolai Kondrashov "$COVERAGE_MIN_FUNCS" \
933c7c5efc76b4a9f3206b36bf6fe60e5dd635f1Nikolai Kondrashov < ci-genhtml.out'
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov unset CFLAGS
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Run a build inside a sub-directory.
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Args: id cmd [arg...]
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfunction run_build()
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov{
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare -r id="$1"; shift
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov declare -r dir="ci-build-$id"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov mkdir "$dir"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov printf "%-$((TITLE_WIDTH + RESULT_WIDTH))s%s\n" \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "${id^^} BUILD:" "`disppath \"\$dir\"`"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov cd "$dir"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov "$@"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov cd ..
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov}
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov# Main routine
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov#
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdeclare args_expr
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovargs_expr=`getopt --name \`basename "\$0"\` \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --options hp:nemrf \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --longoptions help,prefix:,no-deps \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --longoptions essential,moderate,rigorous,full \
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -- "$@"`
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashoveval set -- "$args_expr"
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovwhile true; do
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov case "$1" in
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -h|--help)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov usage; exit 0;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -p|--prefix)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov BASE_PFX="$2"; shift 2;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -n|--no-deps)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov DEPS=false; shift;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -e|--essential)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov MODERATE=false; RIGOROUS=false; shift;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -m|--moderate)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov MODERATE=true; RIGOROUS=false; shift;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov -r|--rigorous|-f|--full)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov MODERATE=true; RIGOROUS=true; shift;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov --)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov shift; break;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov *)
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov echo "Unknown option: $1" >&2
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov exit 1;;
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov esac
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovdone
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovif [ $# != 0 ]; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov echo "Positional arguments are not accepted." >&2
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov usage >&2
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov exit 1
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfi
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovtrap 'echo FAILURE' EXIT
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovrm_rf_ro ci-*
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovexport V=1
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovif "$DEPS"; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov stage install-deps deps_install
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfi
89f5332ccf59672ecafc36abe07d2351e32a05d5Fabiano Fidêncioif [[ "$DISTRO_BRANCH" != redhat-* ]]; then
89f5332ccf59672ecafc36abe07d2351e32a05d5Fabiano Fidêncio # Ignore "E722 do not use bare except" exceptions
89f5332ccf59672ecafc36abe07d2351e32a05d5Fabiano Fidêncio # that are only raised on debian_testing machines.
89f5332ccf59672ecafc36abe07d2351e32a05d5Fabiano Fidêncio PEP8_IGNORE+=",E722"
89f5332ccf59672ecafc36abe07d2351e32a05d5Fabiano Fidênciofi
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidênciostage pep8 find . -path ./src/config -prune -o \
a907aa07340ef0051cd74bbab9618820e1bca1b8Fabiano Fidêncio -name \*.py -exec pep8 $PEP8_IGNORE {} +
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovstage autoreconf autoreconf --install --force
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovrun_build debug build_debug
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovif "$RIGOROUS"; then
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashov run_build coverage build_coverage
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovfi
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovunset V
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovtrap - EXIT
3ce85a5f5264e7118beb6524e120fd8b53a13da4Nikolai Kondrashovecho SUCCESS