From 5883dba0efc97d884cf7f0291b84e236b48b2d7f Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 26 Sep 2019 11:34:35 +0200 Subject: [PATCH] Add code coverage in travis CI. Fix #284 --- .travis.yml | 5 +++++ travis/compile.sh | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fbe59984..00a9e5d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,11 @@ addons: - gcc-mingw-w64-i686 - gcc-mingw-w64-base - mingw-w64-tools + - gcovr + homebrew: + update: true + packages: + - gcovr matrix: include: - env: PLATFORM="native_dyn" diff --git a/travis/compile.sh b/travis/compile.sh index 8720e5ca..07730371 100755 --- a/travis/compile.sh +++ b/travis/compile.sh @@ -38,6 +38,10 @@ else export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/x86_64-linux-gnu/pkgconfig fi export CPPFLAGS="-I${INSTALL_DIR}/include" +if [[ "$TEST" == "1" ]] +then + MESON_OPTION="${MESON_OPTION} -Db_coverage=true" +fi meson . build ${MESON_OPTION} cd build ninja @@ -45,5 +49,9 @@ if [[ "$TEST" == "1" ]] then echo "Running test" 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