[testsuite] skip gdb.base/gdbhistsize-history.exp on remote hosts

Message ID 55F8650E.2020901@codesourcery.com
State New, archived
Headers

Commit Message

Sandra Loosemore Sept. 15, 2015, 6:35 p.m. UTC
  The testcase gdb.base/gdbhistsize-history.exp checks to see whether GDB 
pays attention to the environment variable GDBHISTSIZE.  But, setting 
the environment variable in the .exp script doesn't work when the host 
GDB is running on is remote (think of the case where gdb_start runs a 
ssh command to a remote host to invoke GDB).  It seems best just to skip 
this set of tests in this case.

OK to commit?

-Sandra
  

Comments

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

> The testcase gdb.base/gdbhistsize-history.exp checks to see whether
> GDB pays attention to the environment variable GDBHISTSIZE.  But,
> setting the environment variable in the .exp script doesn't work when
> the host GDB is running on is remote (think of the case where
> gdb_start runs a ssh command to a remote host to invoke GDB).  It
> seems best just to skip this set of tests in this case.

For the record, these tests fail with local-remote-host-native board
file,

$ make check RUNTESTFLAGS="--host_board=local-remote-host-native --target_board=local-remote-host-native HOST_DIR=/tmp/foo/ gdbhistsize-history.exp"
FAIL: gdb.base/gdbhistsize-history.exp: histsize=: show history size
FAIL: gdb.base/gdbhistsize-history.exp: histsize=0: show history size
FAIL: gdb.base/gdbhistsize-history.exp: histsize=0: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=20: show history size
FAIL: gdb.base/gdbhistsize-history.exp: histsize= 20 : show history size
FAIL: gdb.base/gdbhistsize-history.exp: histsize=-5: show history size
FAIL: gdb.base/gdbhistsize-history.exp: histsize=99999999999999999999999999999999999: show history size

>
> OK to commit?

Yes, please.
  

Patch

diff --git a/gdb/testsuite/gdb.base/gdbhistsize-history.exp b/gdb/testsuite/gdb.base/gdbhistsize-history.exp
index 75d98e1..a5d0e43 100644
--- a/gdb/testsuite/gdb.base/gdbhistsize-history.exp
+++ b/gdb/testsuite/gdb.base/gdbhistsize-history.exp
@@ -18,6 +18,14 @@ 
 # Test the setting of "history size" via the GDBHISTSIZE environment variable
 
 
+# We cannot expect remote hosts to see environment variables set on the
+# local machine.
+
+if { [is_remote host] } {
+    unsupported "can't set environment variables on remote host"
+    return -1
+}
+
 # Check that the history size is properly set to SIZE when the environment
 # variable ENV_VAR is set to GDBHISTSIZE.