diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2016-04-07 22:18:49 +0200 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2016-04-07 22:18:49 +0200 |
commit | 2d35e871274a48331c4d6c7b3e4fbee42b901f33 (patch) | |
tree | b5feb2e0719e271fbcbca84c2b7ee29f012c59df | |
parent | 9553661a5f8fb5f82846a04a02b7db8476d986e0 (diff) | |
download | gdb-2d35e871274a48331c4d6c7b3e4fbee42b901f33.zip gdb-2d35e871274a48331c4d6c7b3e4fbee42b901f33.tar.gz gdb-2d35e871274a48331c4d6c7b3e4fbee42b901f33.tar.bz2 |
testsuite: Fix false FAILs with .bashrc GDBHISTFILE=...
$ GDBHISTFILE=/tmp/gdbhistfile runtest gdb.base/gdbhistsize-history.exp gdb.base/gdbinit-history.exp
Running ./gdb.base/gdbinit-history.exp ...
FAIL: gdb.base/gdbinit-history.exp: home=gdbinit-history/unlimited gdbhistsize=1000: show commands
FAIL: gdb.base/gdbinit-history.exp: home=gdbinit-history/unlimited gdbhistsize=foo: show commands
Running ./gdb.base/gdbhistsize-history.exp ...
FAIL: gdb.base/gdbhistsize-history.exp: histsize=: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=20: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize= 20 : show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=-5: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=not_an_integer: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=10zab: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=-5ab: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=99999999999999999999999999999999999: show commands
FAIL: gdb.base/gdbhistsize-history.exp: histsize=50: show commands
This happens for my setup due to my:
$ grep GDB ~/.bashrc
export GDBHISTFILE="$HOME/.gdb_history"
gdb/testsuite/ChangeLog
2016-04-07 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/gdbhistsize-history.exp: Save and unset GDBHISTFILE and
GDBHISTSIZE prior to the tests.
* gdb.base/gdbinit-history.exp: Likewise.
-rw-r--r-- | gdb/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/gdbhistsize-history.exp | 8 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/gdbinit-history.exp | 10 |
3 files changed, 20 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 53755fe..73663c2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,10 @@ -2015-04-07 Pedro Alves <palves@redhat.com> +2016-04-07 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gdb.base/gdbhistsize-history.exp: Save and unset GDBHISTFILE and + GDBHISTSIZE prior to the tests. + * gdb.base/gdbinit-history.exp: Likewise. + +2016-04-07 Pedro Alves <palves@redhat.com> * gdb.compile/compile.exp: Use gdb_compile with "shlib=" option instead of build_executable. Use gdb_load_shlibs. diff --git a/gdb/testsuite/gdb.base/gdbhistsize-history.exp b/gdb/testsuite/gdb.base/gdbhistsize-history.exp index 98d3bf3..16d1068 100644 --- a/gdb/testsuite/gdb.base/gdbhistsize-history.exp +++ b/gdb/testsuite/gdb.base/gdbhistsize-history.exp @@ -32,7 +32,13 @@ if { [is_remote host] } { 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" { diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp index 1e0a588..807f31c 100644 --- a/gdb/testsuite/gdb.base/gdbinit-history.exp +++ b/gdb/testsuite/gdb.base/gdbinit-history.exp @@ -36,12 +36,13 @@ proc test_gdbinit_history_setting { home size { gdbhistsize_val "-" } } { global srcdir global subdir - save_vars { INTERNAL_GDBFLAGS env(GDBHISTSIZE) env(HOME) } { + save_vars { INTERNAL_GDBFLAGS env(GDBHISTFILE) env(GDBHISTSIZE) env(HOME) } { set env(HOME) "$srcdir/$subdir/$home" - # The GDBHISTSIZE environment variable takes precedence over whatever + # 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) if { $gdbhistsize_val != "-" } { @@ -77,10 +78,11 @@ proc test_no_truncation_of_unlimited_history_file { } { global env global INTERNAL_GDBFLAGS - save_vars { INTERNAL_GDBFLAGS env(GDBHISTSIZE) } { - # The GDBHISTSIZE environment variable takes precedence over whatever + save_vars { INTERNAL_GDBFLAGS env(GDBHISTFILE) env(GDBHISTSIZE) } { + # 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 temp_gdbinit [standard_output_file "gdbinit-history.gdbinit"] |