automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] test defs: don't allow `$me' to be overridden from the envir


From: Stefano Lattarini
Subject: Re: [PATCH] test defs: don't allow `$me' to be overridden from the environment
Date: Mon, 18 Apr 2011 21:26:30 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

On Monday 18 April 2011, Ralf Wildenhues wrote:
> * Stefano Lattarini wrote on Mon, Apr 18, 2011 at 12:33:25AM CEST:
> > Subject: [PATCH] test defs: don't allow `$me' to be overridden from the 
> > environment
> > 
> > * tests/defs.in ($me): Use the namespace-safe `$am_test_name' (if
> > it's nonempty) as the default for the initialization of `$me', so
> > that a (not unlikely) environment variable `me' won't wreak havoc
> > in the testsuite.
> 
> This is better, but still lacking an explanation for the question
> I asked earlier.
>
Hmmm...  I thought I had addressed all your questions properly, but
clearly I'm wrong.  Which question have I missed?

> OK with that, and below.
> 
> > --- a/tests/defs.in
> > +++ b/tests/defs.in
> > @@ -65,10 +65,13 @@ test -f "$srcdir/defs.in" || {
> >  }
> >  
> >  # The name of the current test (without the `.test' suffix).
> > -# Test scripts can override it if they need to (but this should
> > -# be done carefully, and *before* including ./defs).
> > -if test -z "$me"; then
> > +# Test scripts can override it if they need to, through the use of
> > +# the namespace-safe variable `$am_test_name' (but this should be
> > +# done carefully, and *before* including ./defs).
> 
> The comment change is redundant with the code change.
>
True, I'll revert it (the previous version of the comment is just fine).

> > +if test -z "$am_test_name"; then
> >    me=`echo "$0" | sed -e 's,.*[\\/],,;s/\.test$//'`
> > +else
> > +  me=$am_test_name
> >  fi
> 
> How about reordering so it reads nicely?  I.e.,
>   if test -n "$am_test_name"; then
>     me=$am_test_name
>   else
>   ...
>
Fine with me.  I'll change this too.

Thanks,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]