File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ EXCLUSIONS=(" $@ " )
6+
7+ # Install lcov if required
8+ LCOV_VERSION=" 1.15"
9+ if [[ ! " $( lcov --version 2> /dev/null || true) " =~ " version ${LCOV_VERSION} " ]]; then
10+ LCOV_ROOT=" /tmp/lcov"
11+ LCOV_URL=" https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION} /lcov-${LCOV_VERSION} .tar.gz"
12+ mkdir -p " ${LCOV_ROOT} "
13+ wget --quiet -O - " ${LCOV_URL} " | tar --strip-components=1 -xz -C " ${LCOV_ROOT} "
14+ export PATH=" ${LCOV_ROOT} /bin:${PATH} "
15+ fi
16+
17+ # Information
18+ " ${GCOV} " --version
19+ lcov --version || true
20+
21+ # capture coverage info
22+ lcov --gcov-tool " ${GCOV} " --directory build --capture --output-file coverage.info --rc lcov_branch_coverage=1 > /dev/null
23+ # Remove everything from /usr (unrelated), external folder (3rd party data), test code
24+ lcov --remove coverage.info ' /usr/*' ' */.cache/*' --output-file coverage.info > /dev/null
25+ for excl in " ${EXCLUSIONS[@]} " ; do
26+ lcov --remove coverage.info " ${excl} " --output-file coverage.info > /dev/null
27+ done
28+
29+ # Debug output
30+ lcov --list coverage.info
Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5- EXCLUSIONS=(" $@ " )
6-
7- # Install lcov if required
8- LCOV_VERSION=" 1.15"
9- if [[ ! " $( lcov --version 2> /dev/null || true) " =~ " version ${LCOV_VERSION} " ]]; then
10- LCOV_ROOT=" /tmp/lcov"
11- LCOV_URL=" https://github.com/linux-test-project/lcov/releases/download/v${LCOV_VERSION} /lcov-${LCOV_VERSION} .tar.gz"
12- mkdir " ${LCOV_ROOT} "
13- wget --quiet -O - " ${LCOV_URL} " | tar --strip-components=1 -xz -C " ${LCOV_ROOT} "
14- export PATH=" ${LCOV_ROOT} /bin:${PATH} "
5+ if ! [ -f coverage.info ]; then
6+ " $( basename " $0 " ) /collectCoverageData.sh" " $@ "
157fi
168
17- # Information
18- " ${GCOV} " --version
19- lcov --version || true
20-
21- # capture coverage info
22- lcov --gcov-tool " ${GCOV} " --directory build --capture --output-file coverage.info --rc lcov_branch_coverage=1 > /dev/null
23- # Remove everything from /usr (unrelated), external folder (3rd party data), test code
24- lcov --remove coverage.info ' /usr/*' ' */.cache/*' --output-file coverage.info > /dev/null
25- for excl in " ${EXCLUSIONS[@]} " ; do
26- lcov --remove coverage.info " ${excl} " --output-file coverage.info > /dev/null
27- done
28-
29- # Debug output
30- lcov --list coverage.info
31-
329# Coverage.io
3310bash <( curl -s https://codecov.io/bash) -f coverage.info || echo " Codecov did not collect coverage reports"
You can’t perform that action at this time.
0 commit comments