automake
[Top][All Lists]
Advanced

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

Re: How do you set VERBOSE for parallel testin


From: Nick Bowler
Subject: Re: How do you set VERBOSE for parallel testin
Date: Wed, 13 May 2015 12:12:04 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On 2015-05-13 08:20 -0700, Arthur Schwarz wrote:
> > Usually I run my tests with something like this:
> 
> > make check -j8 VERBOSE=1
> 
> Thanks Peter.
> 
> My question is is this the only way to use VERBOSE? The Automake Manual
> seems to say that VERBOSE is a variable, not a make argument. And, as a
> variable, if the user (you) can change it's value then the appropriate way
> to do it is either:
>     env VERBOSE=1 make -e check
> or
>     VERBOSE=1; export VERBOSE; make -e check

Look at the Makefile.in which is generated by Automake.  VERBOSE is an
environment variable (at least with the parallel test harness), and the
test condition is that VERBOSE is set to a non-empty value.

The interaction between make variables and environment variables is
complicated.

There are 3 "normal" ways a make variable can be set (this is not the
complete picture but it will do):

 (1) In the environment (FOO=bar make)
 (2) In the Makefile (FOO=bar in the Makefile)
 (3) on the make command line (make FOO=bar)

The priority is in that order: if a variable is set on the command line
it will override any definition in the Makefile, which in turn will
override any definition in the environment.  You can use the -e option
to make to switch the order of (1) and (2), which will probably break a
lot of things.

Now, before make runs a command, it adds the make variables from (3) to
the environment.  Some, but not all[1], make implementations will further
update existing environment variables [those from (1)], with assigned
values from (2).

So the takeaway is this:

 - Never set VERBOSE to any value in Makefile.am.  Such an assignment
   will be useless at best.

 - Use make VERBOSE=1 check to enable verbose mode when running tests.

[1] Results from a quick test: GNU make and Heirloom make update the
    environment, while dmake, NetBSD make, and FreeBSD make do not.

Cheers,
-- 
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)



reply via email to

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