From eba61df4efd69cb536570301399b0e29c4ec1ddf Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 1 May 2017 17:24:43 +0200 Subject: [PATCH] Also track coverage information for C code Fixes: https://github.com/awesomeWM/awesome/issues/1364 Closes: https://github.com/awesomeWM/awesome/pull/1766 --- .travis.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5a8679f5..7f5f56c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -124,6 +124,14 @@ install: fi return 0 } + - | + do_codecov_gcov() { + echo "== do_codecov_gcov in $PWD: $*: ==" + if [ "$DO_COVERAGE" = "codecov" ]; then + travis_retry bash /tmp/codecov-bash -X coveragepy -c -F "$1" || return 1 + fi + return 0 + } # Functions for custom Travis folds. - | @@ -143,6 +151,12 @@ install: } script: - export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -DLUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION -DSTRICT_TESTS=true" + - | + if [ "$DO_COVERAGE" = "codecov" ]; then + export CXXFLAGS="-fprofile-arcs -ftest-coverage" + export CFLAGS="-fprofile-arcs -ftest-coverage" + export LDFLAFS="-fprofile-arcs -ftest-coverage" + fi - | if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then # Break beautiful so that trying to access the theme before beautiful.init() causes an error @@ -181,7 +195,9 @@ script: (make check-unit-coverage \ && do_codecov unittests \ && tests/run.sh \ - && do_codecov functionaltests) + && do_codecov functionaltests \ + && gcov $(find -name '*.o') \ + && do_codecov_gcov c_code) ret=$? travis_fold_end [ "$ret" = 0 ]