autoconf
[Top][All Lists]
Advanced

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

Re: Autotest: using $abs_srcdir with m4_include


From: Ralf Wildenhues
Subject: Re: Autotest: using $abs_srcdir with m4_include
Date: Thu, 27 Apr 2006 22:37:14 +0200
User-agent: Mutt/1.5.11+cvs20060403

Hi Nathaniel,

* Nathaniel D. Sizemore wrote on Thu, Apr 27, 2006 at 07:24:30PM CEST:
> Using Autotest (in Autoconf 2.59), I have a suite in which the tests  
> are grouped logically in directories.  To ease the process of adding  
> tests for the rest of the dev team, each subdirectory has its own  
> 'testsuite.at' file that is included at the top-level tests directory  
> by using m4_include.  For example, if the directory structure is like

> then the testsuite.at file in myProject/tests/ would have the  
> following lines:
> 
> m4_include([$abs_srcdir/type1/testsuite.at])

That won't work: m4_include is a macro which requires M4 literals, as
they will be used at the time m4 is run.  Since you're likely to create
the testsuite in the source tree anway (right?), you could just
  m4_include([type1/testsuite.at])

(you probably also need a `cd $(srcdir)' in the make rule).

Alternatively, you could just list all the input files to `autom4te
--language=autotest' on the command line (in order).

> However, I've discovered that $abs_srcdir does not get expanded in  
> the m4_include() macro for some reason.  I'm using it (and other  
> variables from atconfig) elsewhere, in such macros at AT_CHECK(), and  
> all is well.

Ah, yes, but the first argument of AT_CHECK is evaluated by the shell,
and not by m4, at the time the testsuite is run.  Then, the variables
provided by the atlocal file will be available.

I agree the whole business is tricky to understand at first; for
example, some of the arguments of AT_CHECK are already used at M4 time
for optimization of the code that is put into the test suite.

Hope this helps.

Cheers,
Ralf




reply via email to

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