This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fixing gdb.base/completion.exp (PR testsuite/12649)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]