[Top][All Lists]

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

Re: Minimal example for understanding the usage of TESTS in

From: Simon Richter
Subject: Re: Minimal example for understanding the usage of TESTS in
Date: Thu, 01 Aug 2013 16:30:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130704 Icedove/17.0.7


On 01.08.2013 00:46, Peng Yu wrote:

> I'm not able to understand the usage of TESTS in, as there
> are many other things discussed in conjunction with TESTS and which
> obscures the description of TESTS. Could anybody point me a minimal
> example (without any things unrelated to TESTS) that demonstrates the
> usage of TESTS? Thanks.

While not an example, it can be simplified to:

When 'make check' is run, each file listed in TESTS is executed in turn,
and if the return code is non-zero, this is flagged as an error.

Depending on your project, these files can be either scripts that invoke
a program from your project and verifies its behaviour, or programs that
are specially built, if you want to test a library.

If you write

TESTS = foo bar

then 'make check' will invoke


followed by


How "foo" and "bar" are built is completely independent, for a program
you could use

check_PROGRAMS = foo bar

foo_SOURCES = foo.c
bar_SOURCES = bar.c

The "check_" tells automake to build these programs only before running
the tests.


reply via email to

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