Skip to content

Commit

Permalink
Add comments explaining what lcov lines do.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Delsey committed Feb 5, 2019
1 parent 7e4b735 commit d68e92d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/code_coverage_report.bash
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@ for opt in "$@" ; do
done

mkdir -p $LCOVDIR

# Generate initial zero-coverage data. This adds files that were otherwise not run to the report
lcov -c --initial --rc lcov_branch_coverage=1 --directory build --output-file ${LCOVDIR}/initialcoverage.info

# Capture executed code data.
lcov -c --rc lcov_branch_coverage=1 --directory build --output-file ${LCOVDIR}/testcoverage.info

# Combine the initial zero-coverage report with the executed lines report
lcov -a ${LCOVDIR}/initialcoverage.info -a ${LCOVDIR}/testcoverage.info --rc lcov_branch_coverage=1 --o ${LCOVDIR}/fullcoverage.info

# Only include files that are within this workspace (eg filter out stdio.h etc)
lcov -e ${LCOVDIR}/fullcoverage.info "${PWD}/*" --rc lcov_branch_coverage=1 --output-file ${LCOVDIR}/workspacecoverage.info

# Remove files in the build subdirectory because they are generated files (like messages, services, etc)
lcov -r ${LCOVDIR}/workspacecoverage.info "${PWD}/build/*" --rc lcov_branch_coverage=1 --output-file ${LCOVDIR}/projectcoverage.info

if [ $COVERAGE_REPORT = codecovio ]; then
bash <(curl -s https://codecov.io/bash) -f ${LCOVDIR}/projectcoverage.info
else
Expand Down

0 comments on commit d68e92d

Please sign in to comment.