[0/5] gdb/testsuite: stricter matching for gdb_test

Message ID cover.1680293848.git.aburgess@redhat.com
Headers
Series gdb/testsuite: stricter matching for gdb_test |

Message

Andrew Burgess March 31, 2023, 8:20 p.m. UTC
  The goal of this series is to make the pattern matching in gdb_test
stricter with respect to end of line sequences.  This encourages us
all to be a little more precise when writting the output patterns for
use in gdb_test, but I think this is a good thing for GDB - our tests
will get a little stricter.

The final patch adds a new feature to gdb_test, a modified version of
the '^' anchor, which again, should (I hope) allow us to write
stricter output patterns, which I think is a good thing for GDB.

Thanks,
Andrew

---

Andrew Burgess (5):
  gdb/testsuite: fix occasional failure in
    gdb.base/clear_non_user_bp.exp
  gdb: remove some trailing newlines from warning messages
  gdb/testsuite: use 'return' in gdb_test_no_output
  gdb/testsuite: change newline patterns used in gdb_test
  gdb/testsuite: special case '^' in gdb_test pattern

 gdb/language.c                                |   8 +-
 gdb/remote.c                                  |   4 +-
 gdb/testsuite/gdb.ada/varsize_limit.exp       |   2 +-
 gdb/testsuite/gdb.arch/amd64-entry-value.exp  |  59 +++++++---
 .../gdb.arch/amd64-invalid-stack-middle.exp   |   4 +-
 .../gdb.arch/amd64-invalid-stack-top.exp      |   4 +-
 gdb/testsuite/gdb.base/call-rt-st.exp         |   2 +-
 gdb/testsuite/gdb.base/charset.exp            |   4 +-
 gdb/testsuite/gdb.base/clear_non_user_bp.exp  |   2 +-
 gdb/testsuite/gdb.base/compare-sections.exp   |   2 +-
 gdb/testsuite/gdb.base/default.exp            |   4 +-
 gdb/testsuite/gdb.base/display.exp            |  10 +-
 gdb/testsuite/gdb.base/foll-fork.exp          |   2 +-
 gdb/testsuite/gdb.base/fullpath-expand.exp    |   4 +-
 gdb/testsuite/gdb.base/info-macros.exp        |  12 +-
 .../gdb.base/multi-line-starts-subshell.exp   |   2 +-
 gdb/testsuite/gdb.base/new-ui-echo.exp        |   4 +-
 gdb/testsuite/gdb.base/new-ui.exp             |   6 +-
 gdb/testsuite/gdb.base/pc-fp.exp              |   2 +-
 gdb/testsuite/gdb.base/pending.exp            |   2 +-
 gdb/testsuite/gdb.base/rtld-step.exp          |   4 +-
 gdb/testsuite/gdb.base/setshow.exp            |   4 +-
 gdb/testsuite/gdb.base/settings.exp           |   9 +-
 gdb/testsuite/gdb.base/signals.exp            |   2 +-
 gdb/testsuite/gdb.base/until.exp              |   2 +-
 gdb/testsuite/gdb.base/watch-bitfields.exp    |   4 +-
 gdb/testsuite/gdb.base/watchpoint.exp         |  17 +--
 gdb/testsuite/gdb.base/with.exp               |  15 ++-
 .../gdb.base/wrong_frame_bt_full.exp          |   4 +-
 gdb/testsuite/gdb.btrace/buffer-size.exp      |   4 +-
 .../gdb.btrace/function_call_history.exp      |   2 +-
 .../gdb.btrace/instruction_history.exp        |  10 +-
 gdb/testsuite/gdb.btrace/record_goto.exp      |   8 +-
 .../gdb.cp/incomplete-type-overload.exp       |   2 +-
 gdb/testsuite/gdb.cp/maint.exp                |   8 +-
 gdb/testsuite/gdb.cp/ovldbreak.exp            |  14 +--
 gdb/testsuite/gdb.cp/userdef.exp              |  20 ++--
 gdb/testsuite/gdb.cp/virtfunc.exp             |  23 +++-
 gdb/testsuite/gdb.guile/scm-breakpoint.exp    |   2 +-
 gdb/testsuite/gdb.guile/scm-cmd.exp           |   2 +-
 gdb/testsuite/gdb.linespec/break-ask.exp      |   4 +-
 .../gdb.mi/user-selected-context-sync.exp     |   2 +-
 gdb/testsuite/gdb.opt/inline-break.exp        |   6 +-
 gdb/testsuite/gdb.python/py-breakpoint.exp    |   6 +-
 gdb/testsuite/gdb.python/py-framefilter.exp   |   2 +-
 gdb/testsuite/gdb.python/python.exp           |   2 +-
 .../gdb.reverse/machinestate-precsave.exp     |  60 +++++-----
 gdb/testsuite/gdb.reverse/machinestate.exp    |  60 +++++-----
 gdb/testsuite/gdb.stabs/exclfwd.exp           |   4 +-
 .../gdb.threads/foll-fork-other-thread.exp    |   2 +-
 gdb/testsuite/gdb.threads/gcore-thread.exp    |   4 +-
 gdb/testsuite/gdb.trace/actions.exp           | 109 +++++++++---------
 gdb/testsuite/gdb.trace/deltrace.exp          |  73 ++++++------
 gdb/testsuite/gdb.trace/infotrace.exp         |   6 +-
 gdb/testsuite/gdb.trace/passcount.exp         |   8 +-
 gdb/testsuite/gdb.trace/tracecmd.exp          |   8 +-
 gdb/testsuite/gdb.trace/while-stepping.exp    |   2 +-
 gdb/testsuite/lib/gdb.exp                     |  35 ++++--
 58 files changed, 385 insertions(+), 303 deletions(-)


base-commit: 3712e78cab09017bf59105d44e2f745c5e608c5a
  

Comments

Tom Tromey April 17, 2023, 4:12 p.m. UTC | #1
>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:

Andrew> The goal of this series is to make the pattern matching in gdb_test
Andrew> stricter with respect to end of line sequences.  This encourages us
Andrew> all to be a little more precise when writting the output patterns for
Andrew> use in gdb_test, but I think this is a good thing for GDB - our tests
Andrew> will get a little stricter.

Andrew> The final patch adds a new feature to gdb_test, a modified version of
Andrew> the '^' anchor, which again, should (I hope) allow us to write
Andrew> stricter output patterns, which I think is a good thing for GDB.

Thank you for doing this.  I read through this and I think it all looks
good, and seems like a worthwhile improvement.

Reviewed-By: Tom Tromey <tom@tromey.com>

Tom
  
Andrew Burgess April 27, 2023, 12:58 p.m. UTC | #2
Tom Tromey <tom@tromey.com> writes:

>>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Andrew> The goal of this series is to make the pattern matching in gdb_test
> Andrew> stricter with respect to end of line sequences.  This encourages us
> Andrew> all to be a little more precise when writting the output patterns for
> Andrew> use in gdb_test, but I think this is a good thing for GDB - our tests
> Andrew> will get a little stricter.
>
> Andrew> The final patch adds a new feature to gdb_test, a modified version of
> Andrew> the '^' anchor, which again, should (I hope) allow us to write
> Andrew> stricter output patterns, which I think is a good thing for GDB.
>
> Thank you for doing this.  I read through this and I think it all looks
> good, and seems like a worthwhile improvement.
>
> Reviewed-By: Tom Tromey <tom@tromey.com>

Pushed.

Thanks,
Andrew