automake-patches
[Top][All Lists]
Advanced

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

Re: [FYI] {master} docs: fix unportable example of AM_TESTS_ENVIRONMENT


From: Stefano Lattarini
Subject: Re: [FYI] {master} docs: fix unportable example of AM_TESTS_ENVIRONMENT usage
Date: Thu, 30 Jun 2011 22:45:02 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

On Thursday 30 June 2011, Ralf Wildenhues wrote:
> Hi Stefano,
> 
> * Stefano Lattarini wrote on Thu, Jun 23, 2011 at 10:56:31PM CEST:
> > On Thursday 23 June 2011, Ralf Wildenhues wrote:
> > > > -AM_TESTS_ENVIRONMENT = exec 9>&2; warn_fileno=9; export warn_fileno;
> > > 
> > > This example served two purposes: use of AM_TESTS_ENVIRONMENT, and
> > > showing how to produce output while the test is running.  Your patch
> > > removes the second feature.  Can we have it back, ideally in a portable
> > > fashion?
> > >
> > Alas, no.  The only way to do that portably is to either:
> >  1. add a trailing `; >&2' to AM_TESTS_ENVIRONMENT, *and* force the user
> >     not to define TESTS_ENVIRONMENT; or
> >  2. use TESTS_ENVIRONMENT, not AM_TESTS_ENVIRONMENT, in the Makefile.am
> >     (still with a trailing `; >&2' obviously).
> 
> Actually, it used to be nonportable to put the redirection before the
> command.
>
Ouch.

> I'm fairly sure that's only with historic shells and not an
> issue in practice any more (Sven Mascheck's pages will have the details
> for the curious).
>
Good to know (and I can take back my "ouch" ;-)

Anyway, I do think that Eric's original proposal of extending the parallel-tests
harness to allow arbitrary and portable fd redirections is the way to go
eventually; here are my reasons:
 - it would be pretty easy to implement and document;
 - the testsuite harness is being revamped anyway;
 - that change would also benefit all the future custom and built-in test
   drivers;
 - the current hack with "TESTS_ENVIRONMENTS = ...; 9>&2", while continuing to
   work, will prevent the use of AM_TESTS_ENVIRONMENT :-(

> > In each case, the user's namespace is invaded, and we go against our own
> > advice (in [1] we violate the "always terminate AM_TESTS_ENVIRONMENT with
> > a semicolon" rule, in [2] we violate "don't define TESTS_ENVIRONMENT in
> > the Makefile.am, it's user-reserved" rule).
> > 
> > Also, the example above belongs IMHO more in a FAQ rather than in a
> > reference manual.
> 
> Are you volunteering to update the FAQ?  ;-)
>
Oh no ;-)  Not this summer at least.

Regards,
  Stefano



reply via email to

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