[PATCH 2/8] Add test for "layout asm"
Andrew Burgess
andrew.burgess@embecosm.com
Fri Jul 26 11:11:00 GMT 2019
* 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
>
More information about the Gdb-patches
mailing list