[Top][All Lists]

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

Re: make test

From: Eric Blake
Subject: Re: make test
Date: Wed, 26 Jan 2011 09:26:08 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 01/26/2011 08:55 AM, Eve-Marie Devaliere wrote:
> Dear autoconf community,
> I am switching a program from the 'old makefile/configure way' to
> autoconf...
> I got configure and make and make install to work but would like to now
> add the tests that were happening by running 'make test'... (run-time tests)

Autoconf includes the 'autotest' language, which parses a new file to build up a (shell script) testsuite; as well as
documentation for a couple of hooks to add in and your
Makefile to run such a testsuite.  Such tests need not be C programs -
they are anything that you can drive via shell snippets.  In fact,
autoconf's own testsuite is written in the autotest language.  But I'm
not sure if this is what you had in mind.

Meanwhile, Automake has support for building up a testsuite based on
various input files, maybe it's easier to use?

> I have searched the web and I came across  AC_TRY_RUN but it apparently
> requires to run a C program ; the tests were executed with a shell
> script.

AC_TRY_RUN is for determining a platform characteristic at configure
time, not for running a testsuite at make time.  I think you're
confusing the issue, and don't need AC_TRY_RUN for a make-time test.
Also, AC_TRY_RUN is an obsolete wrapper around the newer AC_RUN_IFELSE
macro; this macro does not inherently require a C compiler, but runs a
configure-time compile/run/cross-compile-guess based on the current
language being probed in the file (which is usually C, but
can be Fortran).

Furthermore, if your Makefile already knows how to run your tests, then
your (if you only use autoconf) or (if you also
use automake) can preserve those test rules as-is, and still run those
tests as you have always done as part of make.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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