This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fixing gdb.base/completion.exp (PR testsuite/12649)
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>, Marek Polacek <mpolacek at redhat dot com>, Joel Brobecker <brobecker at adacore dot com>
- Date: Mon, 2 May 2011 18:23:20 +0100
- Subject: Re: [RFC] Fixing gdb.base/completion.exp (PR testsuite/12649)
- References: <4DB82F26.30801@redhat.com> <201105021754.35146.pedro@codesourcery.com> <20110502170338.GA1976@host1.jankratochvil.net>
On Monday 02 May 2011 18:03:38, Jan Kratochvil wrote:
> On Mon, 02 May 2011 18:54:34 +0200, Pedro Alves wrote:
> > I had looked at your new readline test, and it didn't appear
> > to cover every of interesting completion variant this
> > completion.exp test exercises, but I think I may have overlooked.
>
> I believe the good enough test is that "\t" invokes GDB complete_line (via
> readline_line_completion_function). GDB complete_command also obviously leads
> to complete_line.
>
> Therefore if one tests "\t" really works in any single case (which is tested
> by gdb.base/readline-ask.exp as it completes the inferior symbol names) one
> can then test just the "complete" command for all the other completion
> variants with the same coverage.
I think it's mostly about the readline line buffer <-> gdb interaction.
Some examples come to mind from reading completion.exp, not sure
if your test covers all of these:
- test that the command that was completed works after "\n", lest
we got the completion correctly, but left the line/command buffer
clobbered, and we execute the wrong command, for example.
- test what happens if you write a full command, and try to expand,
and there is no possible completion. execute the command. check that
it did really execute, and that the completion code didn't clobber the
internal line/command buffer.
- test that gdb asks a question on completion request; test that
the question looks sane, and that when we answer it, the correct
answer is actually chosen. I think your test does some of this.
- test that \t completion works correctly (or doesn't work) when there's
a trailing whitespace
--
Pedro Alves