diff --git a/.travis.yml b/.travis.yml index fbe599848..00a9e5d63 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 8720e5ca0..07730371e 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