CI: preprocess coverage with lcov for codecov.io
We preprocess gcov output with lcov before feeding it to codecov. For the following reasons: * codecov seems to support LCOV pseudo-pragmas only if they match the pattern "// LCOV_EXCL" * It is easier to understand what will happen in codecov if we feed a preprocessed lcov file than a pile of raw gcov files * We can reproduce that step locally and therefore do quicker trials * Branch coverage is not correct when feeding gcov raw input to codecov + We avoid feeding gcovr's output to codecov: Codecov upload bash script also sees shippable/codecoverage/coverage.xml but when this is uploaded together with lcov's the branch coverage is not correct, and some not compiled in files are reported as not covered. Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This commit is contained in:
parent
600c8f7d85
commit
d82ff1770d
1 changed files with 10 additions and 6 deletions
|
@ -78,10 +78,12 @@ build:
|
||||||
- >
|
- >
|
||||||
if [ "$MATRIX_BUILD" = "1" ]; then
|
if [ "$MATRIX_BUILD" = "1" ]; then
|
||||||
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
||||||
mv sanity-out/native_posix/ coverage_native_posix/;
|
lcov --capture --directory sanity-out/native_posix/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
|
||||||
|
lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
|
||||||
|
rm lcov.pre.info;
|
||||||
rm -rf sanity-out out-2nd-pass;
|
rm -rf sanity-out out-2nd-pass;
|
||||||
bash <(curl -s https://codecov.io/bash) -f '!*.lst' -X coveragepy -X fixes;
|
bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
|
||||||
rm -rf coverage_native_posix/;
|
rm lcov.info;
|
||||||
else
|
else
|
||||||
rm -rf sanity-out out-2nd-pass;
|
rm -rf sanity-out out-2nd-pass;
|
||||||
fi;
|
fi;
|
||||||
|
@ -101,10 +103,12 @@ build:
|
||||||
- >
|
- >
|
||||||
if [ "$MATRIX_BUILD" = "1" ]; then
|
if [ "$MATRIX_BUILD" = "1" ]; then
|
||||||
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
||||||
mv sanity-out/native_posix/ coverage_native_posix/;
|
lcov --capture --directory sanity-out/native_posix/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
|
||||||
|
lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
|
||||||
|
rm lcov.pre.info;
|
||||||
rm -rf sanity-out out-2nd-pass;
|
rm -rf sanity-out out-2nd-pass;
|
||||||
bash <(curl -s https://codecov.io/bash) -f '!*.lst' -X coveragepy -X fixes;
|
bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
|
||||||
rm -rf coverage_native_posix/;
|
rm lcov.info;
|
||||||
else
|
else
|
||||||
rm -rf sanity-out out-2nd-pass;
|
rm -rf sanity-out out-2nd-pass;
|
||||||
fi;
|
fi;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue