Discussion:
Best practice sharing autotest macros
Luke Mewburn
2013-11-29 03:32:56 UTC
Permalink
Hi folks,

I've got a few autotest macros that are used across various projects,
and I'm looking for advice regardard the best practice in how to
share these between the projects. Currently I just cut and paste
our autotest macros to the project's local.at.

For autoconf macros, common macros are used by storing them in a common
/path and with ACLOCAL_AMFLAGS = -I/path in the top-level Makefile.am,
and aclocal automagically finds the macro definition.

I have considered a shared /path and passing -I/path to autom4te,
which requires an explicit m4_include([foo.m4]) to bring in the
definition, because autom4te doesn't appear to do the same automagic
macro finding that aclocal does.

Do people have any advice, better suggestions, etc?

Also, is this list a good place to discuss adding more autotest AT_
macros to autotest?

Thanks,
Luke.
Eric Blake
2013-12-03 17:02:02 UTC
Permalink
Post by Luke Mewburn
Hi folks,
I've got a few autotest macros that are used across various projects,
and I'm looking for advice regardard the best practice in how to
share these between the projects. Currently I just cut and paste
our autotest macros to the project's local.at.
For autoconf macros, common macros are used by storing them in a common
/path and with ACLOCAL_AMFLAGS = -I/path in the top-level Makefile.am,
and aclocal automagically finds the macro definition.
I have considered a shared /path and passing -I/path to autom4te,
which requires an explicit m4_include([foo.m4]) to bring in the
definition, because autom4te doesn't appear to do the same automagic
macro finding that aclocal does.
Sounds reasonable to me.
Post by Luke Mewburn
Do people have any advice, better suggestions, etc?
Sorry, none from me - but do feel free to post what works for you, so we
have it in the archives.
Post by Luke Mewburn
Also, is this list a good place to discuss adding more autotest AT_
macros to autotest?
Yes.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Luke Mewburn
2013-12-15 08:24:59 UTC
Permalink
On Tue, Dec 03, 2013 at 10:02:02AM -0700, Eric Blake wrote:
| On 11/28/2013 08:32 PM, Luke Mewburn wrote:
| > I've got a few autotest macros that are used across various projects,
| > and I'm looking for advice regardard the best practice in how to
| > share these between the projects. Currently I just cut and paste
| > our autotest macros to the project's local.at.
| >
| > For autoconf macros, common macros are used by storing them in a common
| > /path and with ACLOCAL_AMFLAGS = -I/path in the top-level Makefile.am,
| > and aclocal automagically finds the macro definition.
| >
| > I have considered a shared /path and passing -I/path to autom4te,
| > which requires an explicit m4_include([foo.m4]) to bring in the
| > definition, because autom4te doesn't appear to do the same automagic
| > macro finding that aclocal does.
|
| Sounds reasonable to me.
|
| >
| > Do people have any advice, better suggestions, etc?
|
| Sorry, none from me - but do feel free to post what works for you, so we
| have it in the archives.


What I've found works so far is:

1. Install the .m4 files containing my autotest macros into a common
location (e.g /usr/local/share/aclocal).

2. In tests/local.at, explicitly m4_include([...]) my macro files
by relative filename.

3. Add -I/usr/local/share/aclocal to the $(AUTOMATE) invocation for
the $(TESTSUITE) rule in tests/Makefile.am.



regards,
Luke.

Loading...