[1/2] Don't let .gdb_history file cause failures

Message ID 20230123220257.3773828-2-tromey@adacore.com
State Committed
Commit 300fa060abbfd8d36c81d8cc777ea1f32f07b4f0
Headers
Series Suppress some FAILs |

Commit Message

Tom Tromey Jan. 23, 2023, 10:02 p.m. UTC
  I had a .gdb_history file in my testsuite directory in the build tree,
and this provoked a failure in gdbhistsize-history.exp.  It seems
simple to prevent this file from causing a failure.
---
 gdb/testsuite/gdb.base/gdbhistsize-history.exp | 4 ++++
 1 file changed, 4 insertions(+)
  

Patch

diff --git a/gdb/testsuite/gdb.base/gdbhistsize-history.exp b/gdb/testsuite/gdb.base/gdbhistsize-history.exp
index d3e4a052c6b..f4bf11a10be 100644
--- a/gdb/testsuite/gdb.base/gdbhistsize-history.exp
+++ b/gdb/testsuite/gdb.base/gdbhistsize-history.exp
@@ -39,6 +39,10 @@  proc test_histsize_history_setting { histsize size { env_var "GDBHISTSIZE" } } {
 	unset -nocomplain env(GDBHISTFILE)
 	unset -nocomplain env(GDBHISTSIZE)
 
+	# Ensure we don't accidentally pick up a .gdb_history from the
+	# testsuite directory.
+	set env(GDBHISTFILE) [standard_output_file .gdb_history]
+
 	set env($env_var) $histsize
 
 	with_test_prefix "histsize=$histsize" {