[gdb/testsuite] Fix gdb.tui/completion.exp for local-remote-host-notty
authorTom de Vries <tdevries@suse.de>
Mon, 13 Mar 2023 16:20:09 +0000 (17:20 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 13 Mar 2023 16:20:09 +0000 (17:20 +0100)
When running test-case gdb.tui/completion.exp with host board
local-remote-host-notty and target board native-gdbserver, I get:
...
FAIL: gdb.tui/completion.exp: completion of layout names: \
  tab completion (timeout)
...

The test-case contains a few tests that do tab completion, which requires
readline, which is unavailable with host board local-remote-host-notty.

Fix this by adding the missing check for readline_is_used.

Tested on x86_64-linux.

gdb/testsuite/gdb.tui/completion.exp

index 0a959b4ff8b3c3b15227ffa7234be4b0e48eca91..85abd4a958b3bb96252b9143d8d4aa6070b0c6be 100644 (file)
@@ -48,12 +48,15 @@ proc test_tab_completion {input_line expected_re} {
     }
 }
 
-with_test_prefix "completion of layout names" {
-    test_tab_completion "layout" "asm *next *prev *regs *split *src *"
-}
+if { [readline_is_used] } {
+    with_test_prefix "completion of layout names" {
+       test_tab_completion "layout" "asm *next *prev *regs *split *src *"
+    }
 
-with_test_prefix "completion of focus command" {
-    test_tab_completion "focus" "cmd *next *prev *src *"
+
+    with_test_prefix "completion of focus command" {
+       test_tab_completion "focus" "cmd *next *prev *src *"
+    }
 }
 
 # Now run some completion tests when TUI mode is enabled.