[coverage] Remove subtrees and benchmarks from coverage report #10565

Merged
merged 3 commits into from Jun 22, 2017

Conversation

Projects
None yet
4 participants
Contributor

achow101 commented Jun 9, 2017

Removes stats about leveldb, univalue, and benchmark coverage from the coverage reports. Since we don't test these three items specifically and thus don't care about test coverage for these items.

This builds on top of #10511 to use the faster lcov -r replacement.

@achow101 achow101 Have `make cov` optionally include branch coverage statistics
Added an option to configure to allow for branch coverage statistics gathering.

Disabled logprint macro when coverage testing is on so that unnecessary branches are not analyzed.
c8914b9
Owner

sipa commented Jun 9, 2017

Perhaps remove all the subtrees... including src/crypto/ctaes and src/secp256k1?

achow101 changed the title from [coverage] Remove leveldb, univalue, and benchmarks from coverage report to [coverage] Remove subtrees and benchmarks from coverage report Jun 9, 2017

Contributor

achow101 commented Jun 9, 2017

Removed ctaes and secp256k1 too.

contrib/filter-lcov.py
+ for p in pattern:
+ if line.startswith("SF:") and p in line:
+ in_remove = True
+ if not in_remove:
@sipa

sipa Jun 9, 2017

Owner

This line should probably not be inside the for p in pattern: loop, as it may result in multiple writes of the same input line.

@achow101 achow101 Replace lcov -r commands with faster way
Instead of using lcov -r (which is extremely slow), first use a python script to perform bulk cleanup of the /usr/include/* coverage. Then use lcov -a to remove the duplicate entries. This has the same effect of lcov -r but runs significantly faster
405b86a
Owner

laanwj commented Jun 12, 2017

Concept ACK

Makefile.am
@@ -171,44 +171,32 @@ baseline.info:
$(LCOV) -c -i -d $(abs_builddir)/src -o $@
baseline_filtered.info: baseline.info
- $(abs_builddir)/contrib/filter-lcov.py "/usr/include/" $< $@
+ $(abs_builddir)/contrib/filter-lcov.py -p "/usr/include/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1" $< $@
@sipa

sipa Jun 12, 2017

Owner

Perhaps abstract out the list of things to filter into a variable, as it's used more than once?

@achow101

achow101 Jun 12, 2017

Contributor

done

@achow101 achow101 Filter subtrees and and benchmarks from coverage report
Remove leveldb baseline coverage gathering.

Added filter rules to remove all of the subtress (leveldb, secp256k1, ctaes, univalue) and
benchmarking from the coverage report. These items are unnecessary as we do not test for any
of the subtrees and benchmark coverage is unneeded.
d5711f4
Owner

sipa commented Jun 13, 2017

Tested ACK d5711f4

@laanwj laanwj merged commit d5711f4 into bitcoin:master Jun 22, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@laanwj laanwj added a commit that referenced this pull request Jun 22, 2017

@laanwj laanwj Merge #10565: [coverage] Remove subtrees and benchmarks from coverage…
… report


d5711f4 Filter subtrees and and benchmarks from coverage report (Andrew Chow)
405b86a Replace lcov -r commands with faster way (Andrew Chow)
c8914b9 Have `make cov` optionally include branch coverage statistics (Andrew Chow)

Tree-SHA512: 9c349a7baeb7430ea586617c52f91177df58e3546d6dc573e26815ddb79e30ab1873542d85ac1daca5e1fb2c6d6c8965824b42d027b6b0496a744af57b095852
8c2098a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment