From: Jeff King <peff@peff.net>
To: Derrick Stolee <stolee@gmail.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Git Test Coverage Report (Thursday, Aug 15)
Date: Fri, 16 Aug 2019 14:11:03 -0400 [thread overview]
Message-ID: <20190816181103.GA13894@sigill.intra.peff.net> (raw)
In-Reply-To: <6dd8797a-289d-cabb-d4c3-761b9f9d3ca0@gmail.com>
On Thu, Aug 15, 2019 at 10:01:04PM -0400, Derrick Stolee wrote:
> Here is today's test coverage report.
Are the scripts you use to generate these available somewhere?
I think it's useful to look at uncovered code, but I often struggle to
figure out whether the parts attached to my name are relevant. In
particular, I think two changes to the report format might help:
1. Include names alongside commit ids when listing uncovered lines. I
know that will end up with some overly-long lines, but it makes it
easy to grep for one's name to find relevant sections of the file
(as opposed to finding your name at the bottom and
cross-referencing with actual content lines).
Seeing that an uncovered line is a BUG(), for example, makes it
easy to know that it's not really an interesting uncovered case in
the code.
2. Include more context. Just taking a random example from this email:
> builtin/rebase.c
> e191cc8b 129) strbuf_addstr(&buf, strategy_opts);
We know what the uncovered line was trying to do, but more interesting
is likely the conditional that causes it to be uncovered. In this case
the surrounding code is:
if (opts->ignore_whitespace) {
struct strbuf buf = STRBUF_INIT;
if (strategy_opts)
strbuf_addstr(&buf, strategy_opts);
strbuf_addstr(&buf, " --ignore-space-change");
free(strategy_opts);
strategy_opts = strbuf_detach(&buf, NULL);
}
even the usual 3 lines of diff context would make it a lot quicker to
understand what's going on (it only kicks in when multiple strategy
options are used).
(As an aside, this code leaks the newly allocated buffer and leaves a
dangling pointer in opts->strategy_opts, but that's all orthogonal to
the uncovered line; I'll send a separate message to the original
author).
Anyway, I wonder if we could adjust the output of the script to make
reading it that way a bit easier.
-Peff
next prev parent reply other threads:[~2019-08-16 18:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-16 2:01 Git Test Coverage Report (Thursday, Aug 15) Derrick Stolee
2019-08-16 18:11 ` Jeff King [this message]
2019-08-16 18:15 ` Jeff King
2019-08-20 12:54 ` Derrick Stolee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190816181103.GA13894@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=stolee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).