[testsuite] check for readline support in gdb.base/history-duplicates.exp
Commit Message
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
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
@@ -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.