This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA-v2] testsuite: Add a test for passing of environment variables to inferior
- From: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Tue, 04 Oct 2011 11:27:02 -0600
- Subject: Re: [RFA-v2] testsuite: Add a test for passing of environment variables to inferior
- References: <006301cc8292$367539b0$a35fad10$@muller@ics-cnrs.unistra.fr> <20111004134506.GB24369@calimero.vinschen.de> <000901cc82a4$dfba7cd0$9f2f7670$@muller@ics-cnrs.unistra.fr> <20111004151236.GC15757@calimero.vinschen.de> <12954.5351061553$1317744599@news.gmane.org>
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> 2011-10-04 Pierre Muller <muller@ics.u-strasbg.fr>
Pierre> Add tests for passing of environment variables to inferior.
Pierre> * gdb.base/testenv.c: New test source.
Pierre> * gdb.base/testenv.exp: New expect test.
Thanks for doing this.
Pierre> +#ifdef PROTOTYPES
Pierre> +int main (int argc, char **argv, char **envp)
You don't need to handle the no PROTOTYPES case any more.
Pierre> +if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile} executable {debug}] != "" } {
Pierre> + untested testenv.exp
Pierre> + return -1
Pierre> +}
Pierre> +
Pierre> +# Start with a fresh gdb
Pierre> +
Pierre> +gdb_exit
Pierre> +gdb_start
Pierre> +gdb_reinitialize_dir $srcdir/$subdir
Pierre> +gdb_load ${binfile}
You can use prepare_for_testing instead.
Pierre> +runto main
There's a special runto_main proc for this.
Pierre> +gdb_exit
Pierre> +
Pierre> +set env(TEST_GDB_GLOBAL) "Global environment value"
Pierre> +
Pierre> +gdb_start
Pierre> +gdb_reinitialize_dir $srcdir/$subdir
Pierre> +gdb_load ${binfile}
You can use clean_restart here.
Tom