]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: Fix testing of "info copying"
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Wed, 10 Jan 2024 22:08:36 +0000 (19:08 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Thu, 8 Feb 2024 23:42:59 +0000 (20:42 -0300)
commit0fbd03fda1b693422802ee96f37728dff60f552e
treec0bc8bd285667720d28b616eabd8663c9d0492cd
parent7f26d260ef76a4cb2873a7815bef187005528c19
gdb/testsuite: Fix testing of "info copying"

gdb.base/default.exp has an incomplete test for the "info copying" command,
as poetically pointed out by the FIXME removed by this patch.

The test omits the pattern argument to gdb_test, which causes it to just
check for a GDB prompt at the end of the command output.

The problem is that the command output is the whole GPLv3 license, which
due to its size causes the test to fail sometimes, making the testcase to
be out of sync with GDB's output and failing the tests that follow
it. E.g.,

  FAIL: gdb.base/default.exp: info copying (timeout)
  FAIL: gdb.base/default.exp: info display
  FAIL: gdb.base/default.exp: info frame "f" abbreviation
  PASS: gdb.base/default.exp: info frame
  FAIL: gdb.base/default.exp: info files
  FAIL: gdb.base/default.exp: info float
  FAIL: gdb.base/default.exp: info functions
  FAIL: gdb.base/default.exp: info locals
  FAIL: gdb.base/default.exp: info program
  FAIL: gdb.base/default.exp: info registers
  FAIL: gdb.base/default.exp: info stack "s" abbreviation

Fix by by checking for a few excerpts at the beginning, middle and end of
the license text.  This makes the test consume the command's output in
smallish chunks.

Reviewed-by: Keith Seitz <keiths@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/testsuite/gdb.base/default.exp