From: Sandra Loosemore Date: Thu, 18 Jun 2020 04:57:16 +0000 (-0700) Subject: Fix TUI support checks in gdb.tui tests. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=581bea2c99751391fc49d104d5eacb85bfb63c96;p=binutils-gdb.git Fix TUI support checks in gdb.tui tests. 2020-06-17 Sandra Loosemore gdb/testsuite/ * gdb.tui/basic.exp: Skip test when TUI is unsupported, don't just say UNSUPPORTED. * gdb.tui/corefile-run.exp: Likewise. * gdb.tui/empty.exp: Likewise. * gdb.tui/list-before.exp: Likewise. * gdb.tui/list.exp: Likewise. * gdb.tui/main.exp: Likewise. * gdb.tui/regs.exp: Likewise. * gdb.tui/resize.exp: Likewise. * gdb.tui/tui-layout-asm-short-prog.exp: Likewise. * gdb.tui/tui-layout-asm.exp: Likewise. * gdb.tui/tui-missing-src.exp: Likewise. * gdb.tui/winheight.exp: Likewise. * gdb.tui/new-layout.exp: Likewise. Also move check earlier. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2cdd2ea580f..0e1dc5aaf18 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,22 @@ +2020-06-17 Sandra Loosemore + + Fix TUI support checks in gdb.tui tests. + + * gdb.tui/basic.exp: Skip test when TUI is unsupported, don't + just say UNSUPPORTED. + * gdb.tui/corefile-run.exp: Likewise. + * gdb.tui/empty.exp: Likewise. + * gdb.tui/list-before.exp: Likewise. + * gdb.tui/list.exp: Likewise. + * gdb.tui/main.exp: Likewise. + * gdb.tui/regs.exp: Likewise. + * gdb.tui/resize.exp: Likewise. + * gdb.tui/tui-layout-asm-short-prog.exp: Likewise. + * gdb.tui/tui-layout-asm.exp: Likewise. + * gdb.tui/tui-missing-src.exp: Likewise. + * gdb.tui/winheight.exp: Likewise. + * gdb.tui/new-layout.exp: Likewise. Also move check earlier. + 2020-06-17 Sandra Loosemore Fix TCL error in gdb.python/py-format-string.exp. diff --git a/gdb/testsuite/gdb.tui/basic.exp b/gdb/testsuite/gdb.tui/basic.exp index 3e013a95151..0296e542868 100644 --- a/gdb/testsuite/gdb.tui/basic.exp +++ b/gdb/testsuite/gdb.tui/basic.exp @@ -26,6 +26,7 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" + return } set text [Term::get_all_lines] diff --git a/gdb/testsuite/gdb.tui/corefile-run.exp b/gdb/testsuite/gdb.tui/corefile-run.exp index 1878770bdcd..94a599e8973 100644 --- a/gdb/testsuite/gdb.tui/corefile-run.exp +++ b/gdb/testsuite/gdb.tui/corefile-run.exp @@ -47,6 +47,7 @@ if { ![gdb_gcore_cmd "$core" "save a corefile"] } { Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" + return } set text [Term::get_all_lines] diff --git a/gdb/testsuite/gdb.tui/empty.exp b/gdb/testsuite/gdb.tui/empty.exp index 89f49d6b7f9..50c8be42f5b 100644 --- a/gdb/testsuite/gdb.tui/empty.exp +++ b/gdb/testsuite/gdb.tui/empty.exp @@ -23,6 +23,7 @@ Term::clean_restart 24 80 if {![Term::enter_tui]} { unsupported "TUI not supported" + return } # Each entry describes a layout. It has these items: diff --git a/gdb/testsuite/gdb.tui/list-before.exp b/gdb/testsuite/gdb.tui/list-before.exp index 9c5eb5655ea..fce745db7e0 100644 --- a/gdb/testsuite/gdb.tui/list-before.exp +++ b/gdb/testsuite/gdb.tui/list-before.exp @@ -29,6 +29,7 @@ gdb_test "list main" if {![Term::enter_tui]} { unsupported "TUI not supported" + return } Term::check_contents "initial source listing" "21 *return 0" diff --git a/gdb/testsuite/gdb.tui/list.exp b/gdb/testsuite/gdb.tui/list.exp index b1e59499c87..77dbd69efd8 100644 --- a/gdb/testsuite/gdb.tui/list.exp +++ b/gdb/testsuite/gdb.tui/list.exp @@ -26,6 +26,7 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" + return } Term::check_contents "initial source listing" "21 *return 0" diff --git a/gdb/testsuite/gdb.tui/main.exp b/gdb/testsuite/gdb.tui/main.exp index fd3c2cd8157..38e2e5bc726 100644 --- a/gdb/testsuite/gdb.tui/main.exp +++ b/gdb/testsuite/gdb.tui/main.exp @@ -31,6 +31,7 @@ gdb_test_no_output "set interactive-mode off" if {![Term::enter_tui]} { unsupported "TUI not supported" + return } Term::command "file [standard_output_file $testfile]" diff --git a/gdb/testsuite/gdb.tui/new-layout.exp b/gdb/testsuite/gdb.tui/new-layout.exp index 3ea4dd40699..b4fca674e89 100644 --- a/gdb/testsuite/gdb.tui/new-layout.exp +++ b/gdb/testsuite/gdb.tui/new-layout.exp @@ -23,6 +23,13 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { return -1 } +# Make sure TUI is supported before continuing. +Term::clean_restart 24 80 $testfile +if {![Term::enter_tui]} { + unsupported "TUI not supported" + return +} + Term::clean_restart 24 80 $testfile gdb_test "tui new-layout" \ @@ -59,6 +66,7 @@ gdb_test "help layout h" \ if {![Term::enter_tui]} { unsupported "TUI not supported" + return } set text [Term::get_all_lines] diff --git a/gdb/testsuite/gdb.tui/regs.exp b/gdb/testsuite/gdb.tui/regs.exp index a9296a7d5fa..3d635236e81 100644 --- a/gdb/testsuite/gdb.tui/regs.exp +++ b/gdb/testsuite/gdb.tui/regs.exp @@ -32,6 +32,7 @@ if {![runto_main]} { if {![Term::enter_tui]} { unsupported "TUI not supported" + return } Term::check_contents "source at startup" "\\|.*21 *return 0" diff --git a/gdb/testsuite/gdb.tui/resize.exp b/gdb/testsuite/gdb.tui/resize.exp index fd1b35088af..bf32251c457 100644 --- a/gdb/testsuite/gdb.tui/resize.exp +++ b/gdb/testsuite/gdb.tui/resize.exp @@ -32,6 +32,7 @@ if {![runto_main]} { if {![Term::enter_tui]} { unsupported "TUI not supported" + return } Term::check_contents "source at startup" "\\|.*21 *return 0" diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp index 50cb61f0faa..1a7992502ad 100644 --- a/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp +++ b/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.exp @@ -29,6 +29,7 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile} \ Term::clean_restart 24 80 $testfile if {![Term::prepare_for_tui]} { unsupported "TUI not supported" + return } # This puts us into TUI mode, and should display the ASM window. diff --git a/gdb/testsuite/gdb.tui/tui-layout-asm.exp b/gdb/testsuite/gdb.tui/tui-layout-asm.exp index 44f7a3a3a4f..96fb043321f 100644 --- a/gdb/testsuite/gdb.tui/tui-layout-asm.exp +++ b/gdb/testsuite/gdb.tui/tui-layout-asm.exp @@ -27,6 +27,7 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { Term::clean_restart 24 80 $testfile if {![Term::prepare_for_tui]} { unsupported "TUI not supported" + return } # This puts us into TUI mode, and should display the ASM window. diff --git a/gdb/testsuite/gdb.tui/tui-missing-src.exp b/gdb/testsuite/gdb.tui/tui-missing-src.exp index 6b5c7fad4c4..a8460c6514a 100644 --- a/gdb/testsuite/gdb.tui/tui-missing-src.exp +++ b/gdb/testsuite/gdb.tui/tui-missing-src.exp @@ -75,6 +75,7 @@ file delete $mainfile Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" + return } # There must exist a source layout with the size 80x15 and # there should be nothing in it. diff --git a/gdb/testsuite/gdb.tui/winheight.exp b/gdb/testsuite/gdb.tui/winheight.exp index 8ac55f84723..bbfb7de3760 100644 --- a/gdb/testsuite/gdb.tui/winheight.exp +++ b/gdb/testsuite/gdb.tui/winheight.exp @@ -26,6 +26,7 @@ if {[build_executable "failed to prepare" ${testfile} ${srcfile}] == -1} { Term::clean_restart 24 80 $testfile if {![Term::enter_tui]} { unsupported "TUI not supported" + return } Term::check_box "source box" 0 0 80 15