From: Jeff King <peff@peff.net>
To: Stefan Beller <sbeller@google.com>
Cc: Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Jonathan Nieder <jrnieder@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb
Date: Tue, 27 Oct 2015 19:58:24 -0400 [thread overview]
Message-ID: <20151027235823.GD4172@sigill.intra.peff.net> (raw)
In-Reply-To: <CAGZ79karRbOTSEfFHRU6MG21T1L5GyuZW2ATqfdP4NE7wHMmHQ@mail.gmail.com>
On Tue, Oct 27, 2015 at 04:39:37PM -0700, Stefan Beller wrote:
> On Tue, Oct 27, 2015 at 4:28 PM, Jeff King <peff@peff.net> wrote:
> > I agree doing so would be crazy. But would:
> >
> > ./t1234-frotz.sh --gdb=17
> >
> > be sane to run gdb only inside test 17?
>
> OT:
> We have two ways of addressing tests, by number and by name.
Yeah. The numbers are not stable if the script gets new test, but they
are usually fine for within a debugging session. Names are annoying to
type (and also not guaranteed unique).
> Usually when a test fails ("Foo gobbles the bar correctly" failed),
> I want to run tests 1,17 (1 is the correct setup and 17 is the failing test)
> But coming up with that tuple is hard.
> * How do I know we need to run 1 as the setup ? (usually we do,
> sometimes we don't and other times we also need 2,3 to completely
> setup the tests)
I think trying to deduce that tuple is a fool's errand. It takes a lot
of manual work, and even if you _think_ you have it, sometimes state
left from earlier tests is accidentally important. But it's usually not
that expensive to run earlier tests at all; it's just expensive to run
them with extra debugging. That's why we have options like
"--valgrind-only=17". We still _run_ tests 1..16, but we do it quickly,
and then execute the expensive and slow valgrind git only on the
suspicious one.
And I'd propose --gdb to work the same way (run all the other tests, but
only kick in gdb for the suspicious one).
If you had multiple "git" invocations inside test 17, you could even do
something like "--gdb=17:4" to kick in only for the 4th git invocation
or something. But counting up git invocations is probably too irritating
to be worth doing manually.
> * How do I know it's test 17 which is failing? My workflow up to now
> I just searched the test title in the file, such that I'd be there anyway
> to inspect it further. But still I found it inconvenient to
> mentally map between
> 17 and the test title.
I usually just run the test script and look at the output. Here's a
failure (which I obviously induced with an extra line):
$ ./t4103-apply-binary.sh -v -i
[...]
ok 5 - check binary diff -- should fail.
expecting success:
git checkout master &&
echo whoops, we fail here && false &&
test_must_fail git apply --check C.diff
Already on 'master'
whoops, we fail here
not ok 6 - check binary diff (copy) -- should fail.
#
# git checkout master &&
# echo whoops, we fail here && false &&
# test_must_fail git apply --check C.diff
#
I'd pull the test number from the "not ok" above (it's actually even
easier to see if you drop the "-v", but I usually start my debugging
with "-v" anyway, since error messages often make the problem obvious).
-Peff
next prev parent reply other threads:[~2015-10-27 23:58 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 13:14 [PATCH 0/6] Miscellaneous platform-independent patches from Git for Windows Johannes Schindelin
2015-10-26 13:14 ` [PATCH 1/6] Only use CURLOPT_LOGIN_OPTIONS if it is actually available Johannes Schindelin
2015-10-26 20:17 ` Junio C Hamano
2015-10-26 13:15 ` [PATCH 2/6] remote-http(s): Support SOCKS proxies Johannes Schindelin
2015-10-26 20:15 ` Junio C Hamano
2015-10-27 1:23 ` James McCoy
2015-10-27 1:40 ` Junio C Hamano
2015-10-27 15:50 ` Johannes Schindelin
2015-10-27 15:53 ` Johannes Schindelin
2015-10-27 17:27 ` Junio C Hamano
2015-10-27 19:38 ` Junio C Hamano
2015-10-27 21:01 ` Junio C Hamano
2015-10-30 18:38 ` Johannes Schindelin
2015-11-09 22:28 ` Pat Thoyts
2015-11-16 21:49 ` Johannes Schindelin
2015-11-18 6:52 ` Junio C Hamano
2015-10-26 13:15 ` [PATCH 3/6] Facilitate debugging Git executables in tests with gdb Johannes Schindelin
2015-10-26 19:17 ` Jonathan Nieder
2015-10-27 9:42 ` Johannes Schindelin
2015-10-27 16:34 ` Junio C Hamano
2015-10-27 23:28 ` Jeff King
2015-10-27 23:39 ` Stefan Beller
2015-10-27 23:58 ` Jeff King [this message]
2015-10-30 18:25 ` Johannes Schindelin
2015-10-30 19:26 ` Jeff King
2015-10-30 18:27 ` Johannes Schindelin
2015-10-30 18:32 ` Junio C Hamano
2015-10-30 19:02 ` Jonathan Nieder
2015-10-30 19:14 ` Johannes Schindelin
2015-10-30 19:56 ` Jeff King
2015-10-30 21:30 ` Jonathan Nieder
2015-10-30 21:53 ` Junio C Hamano
2015-10-30 18:31 ` Johannes Schindelin
2015-10-30 18:55 ` Jonathan Nieder
2015-10-27 18:09 ` Duy Nguyen
2015-10-29 16:44 ` Junio C Hamano
2015-10-29 5:15 ` Victor Leschuk
2015-10-30 18:42 ` Johannes Schindelin
2015-11-01 5:31 ` Victor Leschuk
2015-11-01 13:37 ` Johannes Schindelin
2015-10-26 13:15 ` [PATCH 4/6] Squelch warning about an integer overflow Johannes Schindelin
2015-10-26 20:23 ` Junio C Hamano
2015-10-30 18:18 ` Johannes Schindelin
2015-10-30 18:21 ` Junio C Hamano
2015-10-26 13:15 ` [PATCH 5/6] Silence GCC's "cast of pointer to integer of a different size" warning Johannes Schindelin
2015-10-26 20:20 ` Junio C Hamano
2015-10-26 13:15 ` [PATCH 6/6] Correct fscanf formatting string for I64u values Johannes Schindelin
2015-10-26 20:20 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151027235823.GD4172@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=sbeller@google.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.
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 NNTP newsgroup(s).