public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed 1/2] [gdb/testsuite] Fix two typos in gdb.python/tui-window-disabled.exp
@ 2023-06-07  9:38 Tom de Vries
  2023-06-07  9:38 ` [pushed 2/2] [gdb/testsuite] Add missing wait " Tom de Vries
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2023-06-07  9:38 UTC (permalink / raw)
  To: gdb-patches

Fix two typos in test-case gdb.python/tui-window-disabled.exp.
---
 gdb/testsuite/gdb.python/tui-window-disabled.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.python/tui-window-disabled.exp b/gdb/testsuite/gdb.python/tui-window-disabled.exp
index b2beb77c217..bee58a86caa 100644
--- a/gdb/testsuite/gdb.python/tui-window-disabled.exp
+++ b/gdb/testsuite/gdb.python/tui-window-disabled.exp
@@ -132,7 +132,7 @@ proc run_test { cleanup_properly } {
     gdb_test "print 2 + 2 + 2" " = 6"
 
     # Now tell the Python code not to check the window is valid before
-    # calling rerended.  The result is the Python code will try to draw to
+    # calling render.  The result is the Python code will try to draw to
     # the screen.  This should throw a Python exception.
     gdb_test_no_output "python perform_valid_check = False"
     set exception_pattern "\r\nPython Exception\[^\n\r\]+TUI window is invalid\[^\n\r\]+"
@@ -153,7 +153,7 @@ proc run_test { cleanup_properly } {
     # Set 'update_title' to True.  The Python script will now try to set
     # the window title when an event occurs (instead of trying to redraw
     # the window). As the window is still not displayed this will again
-    # through an exception.
+    # throw an exception.
     gdb_test_no_output "python update_title = True"
     gdb_test_multiple "next" "next at cli, with an exception for setting the title" {
 	-re -wrap "func \\(5\\);${exception_pattern}" {

base-commit: 3d053417ea7140c3b3a684fcf9edf24abdfa68fd
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pushed 2/2] [gdb/testsuite] Add missing wait in gdb.python/tui-window-disabled.exp
  2023-06-07  9:38 [pushed 1/2] [gdb/testsuite] Fix two typos in gdb.python/tui-window-disabled.exp Tom de Vries
@ 2023-06-07  9:38 ` Tom de Vries
  0 siblings, 0 replies; 2+ messages in thread
From: Tom de Vries @ 2023-06-07  9:38 UTC (permalink / raw)
  To: gdb-patches

While working on PR tui/30526, I noticed a bug in test-case
gdb.python/tui-window-disabled.exp.

Here we send "tui enable" to gdb, but don't wait for it to arrive before
checking for a window box:
...
    send_gdb "tui enable\n"
    Term::check_box "check for python window" 0 0 80 16
...

Fix this by waiting for the prompt to be issued in TUI before doing the check.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.python/tui-window-disabled.exp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/testsuite/gdb.python/tui-window-disabled.exp b/gdb/testsuite/gdb.python/tui-window-disabled.exp
index bee58a86caa..fc69b2b16c2 100644
--- a/gdb/testsuite/gdb.python/tui-window-disabled.exp
+++ b/gdb/testsuite/gdb.python/tui-window-disabled.exp
@@ -186,7 +186,10 @@ proc run_test { cleanup_properly } {
 
     Term::command "layout test"
     Term::command "tui disable"
+
     send_gdb "tui enable\n"
+    gdb_assert { [Term::wait_for "^$::gdb_prompt tui disable"] } "TUI renabled"
+
     Term::check_box "check for python window" 0 0 80 16
 }
 
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-07  9:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-07  9:38 [pushed 1/2] [gdb/testsuite] Fix two typos in gdb.python/tui-window-disabled.exp Tom de Vries
2023-06-07  9:38 ` [pushed 2/2] [gdb/testsuite] Add missing wait " Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).