travis: do coverage using a dedicated build

* .travis.yml (after_success): Remove.
(matrix): Create an entry for the regular x86_64 target.
* travis-success.sh: Merge into ...
* travis-build.sh: ... this file.  Disable optimization
for coverage builds.
* travis-install.sh: Rename COVERAGE=true to CHECK=coverage.
This commit is contained in:
Дмитрий Левин 2016-12-18 00:12:48 +00:00
parent faf03528c2
commit c121227125
4 changed files with 37 additions and 22 deletions

View File

@ -6,8 +6,6 @@ before_install: ./travis-install.sh
script: ./travis-build.sh
after_success: ./travis-success.sh
sudo: required
git:
@ -23,7 +21,6 @@ matrix:
- compiler: gcc
env:
- TARGET=x86_64
- COVERAGE=true
- compiler: gcc
env:
- TARGET=x32
@ -42,3 +39,7 @@ matrix:
- compiler: musl-gcc
env:
- TARGET=x86
- compiler: gcc
env:
- TARGET=x86_64
- CHECK=coverage

View File

@ -17,7 +17,17 @@ case "${TARGET-}" in
;;
x86)
CC="$CC -m32"
export DISTCHECK_CONFIGURE_FLAGS='--build=i686-pc-linux-gnu --target=i686-pc-linux-gnu'
DISTCHECK_CONFIGURE_FLAGS='--build=i686-pc-linux-gnu --target=i686-pc-linux-gnu'
export DISTCHECK_CONFIGURE_FLAGS
;;
esac
case "${CHECK-}" in
coverage)
CHECK_CONFIGURE_FLAGS=--enable-code-coverage
CFLAGS='-g -O0'
CFLAGS_FOR_BUILD="$CFLAGS"
export CFLAGS CFLAGS_FOR_BUILD
;;
esac
@ -26,7 +36,21 @@ export CC_FOR_BUILD="$CC"
./git-set-file-times
./bootstrap
./configure --enable-maintainer-mode ${ENABLE_GCC_WERROR-} ${DISTCHECK_CONFIGURE_FLAGS-}
./configure --enable-maintainer-mode \
${ENABLE_GCC_WERROR-} \
${DISTCHECK_CONFIGURE_FLAGS-} \
${CHECK_CONFIGURE_FLAGS-} \
#
j=-j`getconf _NPROCESSORS_ONLN 2> /dev/null` || j=
make -k $j distcheck VERBOSE=${VERBOSE-}
case "${CHECK-}" in
coverage)
make -k $j all VERBOSE=${VERBOSE-}
make -k $j check VERBOSE=${VERBOSE-}
codecov --gcov-args=-abcp ||:
;;
*)
make -k $j distcheck VERBOSE=${VERBOSE-}
;;
esac

View File

@ -47,7 +47,9 @@ case "$CC" in
;;
esac
if [ "${COVERAGE-}" = true ]; then
apt_get_install lcov
pip install --user codecov
fi
case "${CHECK-}" in
coverage)
apt_get_install lcov
pip install --user codecov
;;
esac

View File

@ -1,12 +0,0 @@
#!/bin/sh -ex
if [ "${COVERAGE-}" = true ]; then
set -- strace-*.tar.xz
tar -xf "$1"
dir="${1%.tar.xz}"
cd "$dir"
export CC_FOR_BUILD="$CC"
./configure --enable-code-coverage
make -k $j all check VERBOSE=${VERBOSE-}
codecov --gcov-args=-abcp ||:
fi