Add code coverage in travis CI. (#285)

Add code coverage in travis CI.
This commit is contained in:
Matthieu Gautier 2019-09-26 11:58:49 +02:00 committed by GitHub
commit c2ecb9d126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -31,6 +31,11 @@ addons:
- gcc-mingw-w64-i686 - gcc-mingw-w64-i686
- gcc-mingw-w64-base - gcc-mingw-w64-base
- mingw-w64-tools - mingw-w64-tools
- gcovr
homebrew:
update: true
packages:
- gcovr
matrix: matrix:
include: include:
- env: PLATFORM="native_dyn" - env: PLATFORM="native_dyn"

View File

@ -38,6 +38,10 @@ else
export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/x86_64-linux-gnu/pkgconfig export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/x86_64-linux-gnu/pkgconfig
fi fi
export CPPFLAGS="-I${INSTALL_DIR}/include" export CPPFLAGS="-I${INSTALL_DIR}/include"
if [[ "$TEST" == "1" ]]
then
MESON_OPTION="${MESON_OPTION} -Db_coverage=true"
fi
meson . build ${MESON_OPTION} meson . build ${MESON_OPTION}
cd build cd build
ninja ninja
@ -45,5 +49,9 @@ if [[ "$TEST" == "1" ]]
then then
echo "Running test" echo "Running test"
export LD_LIBRARY_PATH=${INSTALL_DIR}/lib:${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib/x86_64-linux-gnu export LD_LIBRARY_PATH=${INSTALL_DIR}/lib:${INSTALL_DIR}/lib64:${INSTALL_DIR}/lib/x86_64-linux-gnu
ninja test meson test --verbose
ninja coverage
cd ..
echo "*** Publish code coverage"
bash <(curl -s https://codecov.io/bash)
fi fi