[committed,obvious] gdb/testsuite: Fix TUI support checks in gdb.tui tests

Message ID d9274f69-a363-9d0d-9e14-4e1dc80a0a6b@codesourcery.com
State New
Headers show
Series
  • [committed,obvious] gdb/testsuite: Fix TUI support checks in gdb.tui tests
Related show

Commit Message

Sandra Loosemore June 18, 2020, 5:11 a.m.
I was seeing a bunch of FAILs and ERRORs in gdb.tui tests in a 
remote-host test configuration that doesn't support TUI.   It turns out 
all these tests are checking for TUI support, but only printing an 
UNSUPPORTED message and not doing anything to skip the test.  I'm sure 
that's not intentional since the tests can't possibly work in this 
situation.  I've committed this patch to make all these tests return 
early when the TUI support check fails.

-Sandra

Patch

commit 581bea2c99751391fc49d104d5eacb85bfb63c96
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Wed Jun 17 21:57:16 2020 -0700

    Fix TUI support checks in gdb.tui tests.
    
    2020-06-17 Sandra Loosemore <sandra@codesourcery.com>
    
    	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 2cdd2ea..0e1dc5a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,24 @@ 
 2020-06-17 Sandra Loosemore <sandra@codesourcery.com>
 
+	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 <sandra@codesourcery.com>
+
 	Fix TCL error in gdb.python/py-format-string.exp.
 
 	* gdb.python/py-format-string.exp: Move test for python support
diff --git a/gdb/testsuite/gdb.tui/basic.exp b/gdb/testsuite/gdb.tui/basic.exp
index 3e013a9..0296e54 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 1878770..94a599e 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 89f49d6..50c8be4 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 9c5eb56..fce745d 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 b1e5949..77dbd69 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 fd3c2cd..38e2e5b 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 3ea4dd4..b4fca67 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 a9296a7..3d63523 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 fd1b350..bf32251 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 50cb61f..1a79925 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 44f7a3a..96fb043 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 6b5c7fa..a8460c6 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 8ac55f8..bbfb7de 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