diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2018-10-08 07:52:09 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-10 10:11:35 +0900 |
commit | 783faedd651356663678529109c726bc94d854c0 (patch) | |
tree | 00cf35da634381fa306a3101e1c91e38fc6436ae /git-sh-setup.sh | |
parent | Git 2.19 (diff) | |
download | tgif-783faedd651356663678529109c726bc94d854c0.tar.xz |
contrib: add coverage-diff script
We have coverage targets in our Makefile for using gcov to display line
coverage based on our test suite. The way I like to do it is to run:
make coverage-test
make coverage-report
This leaves the repo in a state where every X.c file that was covered has
an X.c.gcov file containing the coverage counts for every line, and "#####"
at every uncovered line.
There have been a few bugs in recent patches what would have been caught
if the test suite covered those blocks (including a few of mine). I want
to work towards a "sensible" amount of coverage on new topics. In my opinion,
this means that any logic should be covered, but the 'die()' blocks covering
very unlikely (or near-impossible) situations may not warrant coverage.
It is important to not measure the coverage of the codebase by what old code
is not covered. To help, I created the 'contrib/coverage-diff.sh' script.
After creating the coverage statistics at a version (say, 'topic') you can
then run
contrib/coverage-diff.sh base topic
to see the lines added between 'base' and 'topic' that are not covered by the
test suite. The output uses 'git blame -s' format so you can find the commits
responsible and view the line numbers for quick access to the context, but
trims leading tabs in the file contents to reduce output width.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-sh-setup.sh')
0 files changed, 0 insertions, 0 deletions