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: [PATCH 2/8] Add test for "layout asm"


* Tom Tromey <tom@tromey.com> [2019-07-21 12:49:04 -0600]:

> This adds a very simple test for "layout asm".
> 
> gdb/testsuite/ChangeLog
> 2019-07-21  Tom Tromey  <tom@tromey.com>
> 
> 	* gdb.tui/basic.exp: Add "layout asm" test.
> ---
>  gdb/testsuite/ChangeLog         |  4 ++++
>  gdb/testsuite/gdb.tui/basic.exp | 10 ++++++++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.tui/basic.exp b/gdb/testsuite/gdb.tui/basic.exp
> index 48d39741ba5..1eeeaa77606 100644
> --- a/gdb/testsuite/gdb.tui/basic.exp
> +++ b/gdb/testsuite/gdb.tui/basic.exp
> @@ -47,3 +47,13 @@ if {[regexp "21 *return 0" $text]} {
>  # box.
>  setup_xfail *-*-*
>  Term::check_box "source box" 3 0 77 15
> +
> +Term::command "layout asm"
> +set text [Term::get_all_lines]
> +if {[regexp "$hex <main>" $text]} {
> +    pass "asm window shows main"
> +} else {
> +    fail "asm window shows main"
> +}

Wow! This is awesome!  Hopefully this can really drive TUI testing
forward.

I noticed this pattern a lot in this series, I wonder if using
'gdb_assert' would be cleaner?

It even returns true/false so you can do (looking at patch #5 if in
the series):

  if {![gdb_assert {[...condition]} "test name"]} {
    Term::dump_screen
  }

Thanks,
Andrew

> +
> +Term::check_box "asm box" 3 0 77 15
> -- 
> 2.17.2
> 


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