Fix racy output matching in gdb.tui/tui-completion.exp
authorPedro Alves <palves@redhat.com>
Thu, 9 Nov 2017 22:44:10 +0000 (22:44 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 9 Nov 2017 22:47:16 +0000 (22:47 +0000)
commit584a564f366de16d1cecd1910ab0be8ca6167415
treeea759d33b4943734f5210eba2db98ba4221176b4
parent5ed7a928acc231ccd13af71cf6df9900250cf884
Fix racy output matching in gdb.tui/tui-completion.exp

'make check-read1 TESTS="gdb.tui/tui-completion.exp"' exposes this test race:

  (gdb) PASS: gdb.tui/completion.exp: set max-completions unlimited
  layout ^G
  asm    next   prev   regs   split  src
  (gdb) FAIL: gdb.tui/completion.exp: completion of layout names: tab completion
  Quit
  (gdb) PASS: gdb.tui/completion.exp: completion of layout names: quit command input
  focus ^G
  cmd   next  prev  src
  (gdb) FAIL: gdb.tui/completion.exp: completion of focus command: tab completion
  Quit

This is caused by expecting "$gdb_prompt layout $".
gdb_test_multiple's internal prompt regexp can match first if expect's
internal buffer is filled with partial output.  Fix that by splitting
the gdb_test_multiple in question in two.  Since the same problem/code
appears twice in the file, factor out a common procedure.

gdb/testsuite/ChangeLog:
2017-11-09  Pedro Alves  <palves@redhat.com>

* gdb.tui/tui-completion.exp (test_tab_completion): New procedure,
factored out from ...
(top level): ... here, and adjusted to avoid expecting beyond the
prompt in a single gdb_test_multiple.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.tui/completion.exp
This page took 0.024261 seconds and 4 git commands to generate.