Am 18.08.2010 14:58, schrieb David Sommerseth:
> On 18/08/10 14:36, Matthias Andree wrote:
>> Am 18.08.2010 14:27, schrieb David Sommerseth:
>>> This is to avoid 'make check' fail if this extra test case is not
>>> configured.  The patch gives a PASS, but will notify the user that
>>> this test was skipped.
> 
>> The right approach would be to "exit 77" instead of 0,
>> so that "make check" can report the SKIP properly.  Assuming that 
>> t_client.sh is
>> listed in TESTS in some Makefile.am, which I didn't check.
> 
> 
> Ahh!  There it was!  I thought I had seen this before, but I couldn't
> find any good references in the automake manual so far.  I'll fix this
> and send a new patch.

In automake 1.10, it's in chapter 15.1 "Simple Tests" in the second paragraph:

|    The number of failures will be printed at the end of the run.  If a
| given test program exits with a status of 77, then its result is ignored
| in the final count.  This feature allows non-portable tests to be
| ignored in environments where they don't make sense.

Which is not exactly stating the more common use case, as the whole chapter is
rather compact... The feature is still suitable.

On a related node, I personally prefer printing a message how a test could be
enabled, followed by exit 77, over removing unrunnable tests from the TESTS
variable.  See bogofilter.sourceforge.net (either use SVN, or a recent tarball),
particularly src/tests{/Makefile.am|/*} and doc/Makefile.am for an example of a
more elaborate test suite.

Not necessarily the best, and there are more powerful frameworks than what we
use, but it also shows how far the simple automake tests can be taken already,
and perhaps some ideas can be useful.

-- 
Matthias Andree

Reply via email to