Travis: coverage: gcov: process .gnco separately (#2574)

Also uses consistent flags with codecov, i.e. lua53 also with gcov / `#c_code`.
This commit is contained in:
Daniel Hahler 2019-01-10 23:06:54 +01:00 committed by GitHub
parent f75dacb504
commit 3804040dbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 1 deletions

View File

@ -125,7 +125,28 @@ install:
do_codecov_gcov() { do_codecov_gcov() {
echo "== do_codecov_gcov in $PWD: $*: ==" echo "== do_codecov_gcov in $PWD: $*: =="
if [ "$DO_COVERAGE" = "codecov" ]; then if [ "$DO_COVERAGE" = "codecov" ]; then
travis_retry bash /tmp/codecov-bash -X coveragepy -c -F "$1" || return 1 # Report coverage for each .gcno file separately.
# gcov will create .gcov files for the same source (e.g. for
# globalconf.h from awesome.c.gcno and event.c.gcno).
i=0
set -x
(
cd build
find -path "*/lgi-check.dir" -prune -o \( -name '*.gcno' -print \) | while read -r gcno; do
gcov -pb "$gcno"
mkdir gcov.$(( ++i ))
mv *.gcov "gcov.$i"
# Delete any files for /usr.
# They are not relevant and might cause "Invalid path part" errors
# with Code Climate.
find "gcov.$i" -maxdepth 1 -type f -name '#usr#*.gcov' -delete
done
# Upload to Codecov.
travis_retry bash /tmp/codecov-bash -X gcov -X coveragepy -F "$1,${LUANAME//./}"
)
fi fi
return 0 return 0
} }