From: Kevin Buettner <kevinb@cygnus.com>
To: Fernando Nasser <fnasser@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH RFA] gdb.base/completion.exp: Set INPUTRC env variable
Date: Tue, 29 May 2001 20:22:00 -0000 [thread overview]
Message-ID: <1010530032139.ZM29206@ocotillo.lan> (raw)
In-Reply-To: <3B0C56B9.567986F1@redhat.com>
On May 23, 8:32pm, Fernando Nasser wrote:
> But we need to make sure tests do not interfere with others. So, what
> we always do (I hope) when changing globals inside the scope of a test
> is to save the global value, set to whatever the test wants it to be,
> change it back at the end. In this case, you can test if the element
> INPUTRC of the global array "env" exists and, if it does, save it's
> previous value.
>
> However, I can't think of anything else wanting to set or being
> influenced by INPUTRC, so maybe we can be lazy this time and just check
> your patch as is -- better add a FIXME or a NOTE to this fact at least.
> If you feel confident that this is so, please go ahead and check it in.
I do feel confident that nothing else (at the moment) cares about the
value of INPUTRC. However, it seems like a better practice to
save/restore the value of the variable as you've suggested, so that is
what I've done.
I've just committed the patch below. I do not regard myself as a Tcl
expert, so I would appreciate it if someone else would look over this
patch to make sure that I did things properly.
* gdb.base/completion.exp (INPUTRC): Set this environment variable
to a known value in order to get consistent results regardless
of the setting of INPUTRC or the presence or contents of .inputrc.
Index: testsuite/gdb.base/completion.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/completion.exp,v
retrieving revision 1.3
diff -u -p -r1.3 completion.exp
--- completion.exp 2001/05/11 19:53:38 1.3
+++ completion.exp 2001/05/30 02:50:33
@@ -72,6 +72,19 @@ if [get_compiler_info ${binfile}] {
}
gdb_exit
+
+# Don't let a .inputrc file or an existing setting of INPUTRC mess up
+# the test results. Even if /dev/null doesn't exist on the particular
+# platform, the readline library will use the default setting just by
+# failing to open the file. OTOH, opening /dev/null successfully will
+# also result in the default settings being used since nothing will be
+# read from this file.
+global env
+if [info exists env(INPUTRC)] {
+ set old_inputrc $env(INPUTRC)
+}
+set env(INPUTRC) "/dev/null"
+
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
@@ -596,19 +609,12 @@ gdb_expect {
timeout { fail "(timeout) complete 'set follow-fork-mode'" }
}
+# Restore globals modified in this test...
+if [info exists old_inputrc] {
+ set env(INPUTRC) $old_inputrc
+} else {
+ unset env(INPUTRC)
+}
set timeout $oldtimeout1
-return 0
-
-
-
-
-
-
-
-
-
-
-
-
-
+return 0
next prev parent reply other threads:[~2001-05-29 20:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-18 16:59 Kevin Buettner
2001-05-23 17:35 ` Fernando Nasser
2001-05-29 20:22 ` Kevin Buettner [this message]
2001-05-30 5:17 ` Fernando Nasser
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=1010530032139.ZM29206@ocotillo.lan \
--to=kevinb@cygnus.com \
--cc=fnasser@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/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