Patchwork [testsuite,obvious] Add check for readline support to more GDB tab-completion tests.

login
register
mail settings
Submitter Sandra Loosemore
Date Aug. 4, 2019, 9:50 p.m.
Message ID <97e9c585-5811-9dcd-78d1-c85e71a328bf@codesourcery.com>
Download mbox | patch
Permalink /patch/33959/
State New
Headers show

Comments

Sandra Loosemore - Aug. 4, 2019, 9:50 p.m.
This patch makes the new-ish completion-support.exp infrastructure skip 
tab-completion tests if there is no readline support.  This fixes 
several ERRORs we've run into while testing on remote Windows host via ssh.

I thought this was obvious enough to check in immediately since it is 
consistent with some previous patches I've contributed to do similar 
things, e.g. commits

4ee9b0c53a8055b869dfe424846bc00eb0cd0c8f
515b89b30c18dae6b91e57ec2dd336919bb4578d

-Sandra

Patch

commit 26655f53069a2f8a8ccbc6b60537149383d28be1
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Sun Aug 4 14:26:39 2019 -0700

    Add check for readline support to more GDB tab-completion tests.
    
    2019-08-04  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/testsuite/
    	* lib/completion-support.exp (test_gdb_complete_none): Skip
    	tab completion tests if no readline support.
    	(test_gdb_complete_unique_re): Likewise.
    	(test_gdb_complete_multiple): Likewise.

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 91814f2..b4c834d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@ 
+2019-08-04  Sandra Loosemore  <sandra@codesourcery.com>
+
+	* lib/completion-support.exp (test_gdb_complete_none): Skip
+	tab completion tests if no readline support.
+	(test_gdb_complete_unique_re): Likewise.
+	(test_gdb_complete_multiple): Likewise.
+
 2019-08-03  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
 
 	* gdb.base/info_sources.exp: New file.
diff --git a/gdb/testsuite/lib/completion-support.exp b/gdb/testsuite/lib/completion-support.exp
index abe48b4..e081b32 100644
--- a/gdb/testsuite/lib/completion-support.exp
+++ b/gdb/testsuite/lib/completion-support.exp
@@ -217,7 +217,9 @@  proc test_gdb_complete_cmd_multiple { cmd_prefix completion_word completion_list
 # Test that completing LINE completes to nothing.
 
 proc test_gdb_complete_none { input_line } {
-    test_gdb_complete_tab_none $input_line
+    if { [readline_is_used] } {
+	test_gdb_complete_tab_none $input_line
+    }
     test_gdb_complete_cmd_none $input_line
 }
 
@@ -239,7 +241,9 @@  proc test_gdb_complete_none { input_line } {
 
 proc test_gdb_complete_unique_re { input_line complete_line_re {append_char " "} {max_completions 0}} {
     set append_char_re [string_to_regexp $append_char]
-    test_gdb_complete_tab_unique $input_line $complete_line_re $append_char_re
+    if { [readline_is_used] } {
+	test_gdb_complete_tab_unique $input_line $complete_line_re $append_char_re
+    }
 
     # Trim INPUT_LINE and COMPLETE LINE, for the case we're completing
     # a command with leading whitespace.  Leading command whitespace
@@ -282,7 +286,9 @@  proc test_gdb_complete_multiple {
   cmd_prefix completion_word add_completed_line completion_list
   {start_quote_char ""} {end_quote_char ""} {max_completions 0}
 } {
-    test_gdb_complete_tab_multiple "$cmd_prefix$completion_word" $add_completed_line $completion_list $max_completions
+    if { [readline_is_used] } {
+      test_gdb_complete_tab_multiple "$cmd_prefix$completion_word" $add_completed_line $completion_list $max_completions
+    }
     test_gdb_complete_cmd_multiple $cmd_prefix $completion_word $completion_list $start_quote_char $end_quote_char $max_completions
 }