Skip to content

Commit 12c469f

Browse files
committed
build: improve code coverage report by excluding irrelevant code
This removes system files from the report as well as test code.
1 parent 5de7ab8 commit 12c469f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ script:
2020
- make dep.test-data dep.external
2121
- make && make test
2222
after_success:
23-
- if [ "$COVERAGE" = 1 ]; then coveralls -b . -i .build -i bin; fi
23+
- if [ "$COVERAGE" = 1 ]; then coveralls -b . -i lib -e lib/t --gcov-options '\-r'; fi
2424
branches:
2525
except:
2626
- /^wip\//

make/devops-rules.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ test.build-gcov:
1313
check-gcov-quick:
1414
$(MAKE) .gcov-note
1515
mkdir -p $(GCOVDIR)
16-
find $(BINDIR) $(BUILDDIR) -name "*.gcda" \
16+
find $(BINDIR) $(BUILDDIR) -path $(BUILDDIR)/t -prune -o -name "*.gcda" -print \
1717
| xargs $(GCOV) --no-output --preserve-paths \
1818
> $(GCOVDIR)/gcov-report
1919
@echo "See gcov report in $(GCOVDIR)/gcov-report"
2020
check-gcov-full:
2121
$(MAKE) .gcov-note
2222
mkdir -p $(GCOVDIR)
23-
find $(BINDIR) $(BUILDDIR) -name "*.gcda" \
24-
| xargs $(GCOV) --preserve-paths
23+
find $(BINDIR) $(BUILDDIR) -path $(BUILDDIR)/t -prune -o -name "*.gcda" -print \
24+
| xargs $(GCOV) -r --preserve-paths
2525
mv *.gcov $(GCOVDIR)
2626
check-lcov:
2727
$(MAKE) .gcov-note

0 commit comments

Comments
 (0)