This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Always organize test artifacts in a directory hierarchy
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Sun, 7 Feb 2016 11:09:55 +0400
- Subject: Re: [PATCH] Always organize test artifacts in a directory hierarchy
- Authentication-results: sourceware.org; auth=none
- References: <1452268308-23845-1-git-send-email-simon dot marchi at ericsson dot com> <5694F8D2 dot 5090807 at redhat dot com> <56952A6C dot 8070507 at ericsson dot com> <569630EC dot 2000702 at redhat dot com> <20160117063144 dot GB4059 at adacore dot com> <56A6926F dot 6040503 at ericsson dot com> <56AFDF1F dot 1040702 at ericsson dot com>
> > However, when building in-tree, srcdir is relative: ./gdb.ada/fun_addr.
> > When using parallel or always-in-outputs-directory mode, we are cd'ed in
> > the outputs directory. So -I$srcdir is relative to the current
> > directory, which is wrong.
> >
> > To fix it, I made the TCL variable srcdir (set in site.exp, from which
> > everything else is derived) always absolute. It is done by assigning
> > autoconf's abs_srcdir instead of autoconf's srcdir. This way -I$srcdir
> > will always be good, regardless of where we cd'ed to. A small apparent
> > change is that when running tests, DejaGnu will say:
> >
> > Running /tmp/binutils-gdb/gdb/testsuite/gdb.ada/fun_addr.exp ...
> >
> > instead of
> >
> > Running ./gdb.ada/fun_addr.exp ...
> >
> > I hope it's not too much of an annoyance. I think that it should make
> > the testsuite a tiny bit more robust against other bugs of the same
> > class.
> >
> > Regtested in & out of tree, only with native target.
> > ---
> > gdb/testsuite/Makefile.in | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
> > index 7c251d3..38c3052 100644
> > --- a/gdb/testsuite/Makefile.in
> > +++ b/gdb/testsuite/Makefile.in
> > @@ -21,6 +21,7 @@ srcdir = @srcdir@
> > prefix = @prefix@
> > exec_prefix = @exec_prefix@
> > abs_builddir = @abs_builddir@
> > +abs_srcdir = @abs_srcdir@
> >
> > target_alias = @target_noncanonical@
> > program_transform_name = @program_transform_name@
> > @@ -119,7 +120,7 @@ $(abs_builddir)/site.exp site.exp: ./config.status Makefile
> > @echo "set target_alias $(target_alias)" >> ./tmp0
> > @echo "set target_triplet ${target_canonical}" >> ./tmp0
> > @echo "set build_triplet ${build_canonical}" >> ./tmp0
> > - @echo "set srcdir ${srcdir}" >> ./tmp0
> > + @echo "set srcdir ${abs_srcdir}" >> ./tmp0
> > @echo "set tool gdb" >> ./tmp0
> > @echo 'source $${srcdir}/lib/append_gdb_boards_dir.exp' >> ./tmp0
> > @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
OK for me!
--
Joel