[testsuite] check for readline support in gdb.base/history-duplicates.exp

Message ID 55F866B9.6000106@codesourcery.com
State New, archived
Headers

Commit Message

Sandra Loosemore Sept. 15, 2015, 6:43 p.m. UTC
  The testcase gdb.base/history-duplicates.exp checks the interaction 
between "set history remove-duplicates" and scrolling back through 
command history with ^P, thus it only makes sense if readline support is 
present.  I've copied the test that currently appears in readline.exp 
and other places.  OK to commit?

-Sandra
  

Comments

Yao Qi Dec. 14, 2015, 9:27 a.m. UTC | #1
Sandra Loosemore <sandra@codesourcery.com> writes:

> The testcase gdb.base/history-duplicates.exp checks the interaction
> between "set history remove-duplicates" and scrolling back through
> command history with ^P, thus it only makes sense if readline support
> is present.  I've copied the test that currently appears in
> readline.exp and other places.  OK to commit?

Yes, patch is OK.

For the record, there is no fails with board file local-remote-host
(which has tty),

$ make check RUNTESTFLAGS="--host_board=local-remote-host --target_board=local-remote-host  history-duplicates.exp"

but there are some fails with local-remote-host-notty (readline is
disabled due to lack of tty),

FAIL: gdb.base/history-duplicates.exp: remove-duplicates=unlimited: history entry is print 4
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=unlimited: history entry is print 3
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=unlimited: history entry is print 2
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=unlimited: history entry is print 1
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=unlimited: history entry is print 0
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=1: history entry is print 1
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=1: history entry is print 2
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=1: history entry is print 0
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=1: history entry is print 1 (again)
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=1: history entry is print 0 (again)
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=0: history entry is print 1
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=0: history entry is print 1 (again)
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=0: history entry is print 0
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=0: history entry is print 0 (again)
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=2: history entry is print 0
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=2: history entry is print 2
FAIL: gdb.base/history-duplicates.exp: remove-duplicates=2: history entry is print 1
  

Patch

diff --git a/gdb/testsuite/gdb.base/history-duplicates.exp b/gdb/testsuite/gdb.base/history-duplicates.exp
index 11bb1ed..1c3c2c2 100644
--- a/gdb/testsuite/gdb.base/history-duplicates.exp
+++ b/gdb/testsuite/gdb.base/history-duplicates.exp
@@ -51,9 +51,16 @@  proc run_print_on_each_thing { things } {
     }
 }
 
-# By default the option is set to 0.
 gdb_exit
 gdb_start
+
+# These tests require readline support.
+if { ![readline_is_used] } {
+    unsupported "readline isn't used."
+    return -1
+}
+
+# By default the option is set to 0.
 gdb_test "show history remove-duplicates" "is 0\\."
 
 # Test the "unlimited" setting.