From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [testsuite patch] Fix false FAILs with .bashrc GDBHISTFILE=...
Date: Thu, 07 Apr 2016 16:27:00 -0000 [thread overview]
Message-ID: <20160407162728.GA1979@host1.jankratochvil.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]
Hi,
$ 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 in my setup due to my:
$ grep GDB ~/.bashrc
export GDBHISTFILE="$HOME/.gdb_history"
Maybe it is a testsuite regression gdb 7.10->7.11 but I have not checked that
more.
OK for check-in?
Jan
[-- Attachment #2: gdbhist.patch --]
[-- Type: text/plain, Size: 2487 bytes --]
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.
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"]
next reply other threads:[~2016-04-07 16:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-07 16:27 Jan Kratochvil [this message]
2016-04-07 18:30 ` Pedro Alves
2016-04-07 20:20 ` [commit] " Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160407162728.GA1979@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox