[gdb/testsuite] Split up multi-exec test-cases
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / gdbhistsize-history.exp
index 75d98e162f00fb2c8555c6886ff7c86e43649587..6c268f746617a63ddc8393e514e1f4cdad1fa93e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2015 Free Software Foundation, Inc.
+# Copyright 2015-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # 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.
 
 proc test_histsize_history_setting { histsize size { env_var "GDBHISTSIZE" } } {
     global env
 
-    save_vars { env($env_var) } {
+    save_vars { env(GDBHISTFILE) env(GDBHISTSIZE) env($env_var) } {
+       # These environment variables take precedence over whatever
+       # history size is set in .gdbinit.  Make sure the former is not
+       # set.
+       unset -nocomplain env(GDBHISTFILE)
+       unset -nocomplain env(GDBHISTSIZE)
+
        set env($env_var) $histsize
 
        with_test_prefix "histsize=$histsize" {
This page took 0.030545 seconds and 4 git commands to generate.