autoconf-patches
[Top][All Lists]
Advanced

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

Re: Autotest: loops of tests


From: Noah Misch
Subject: Re: Autotest: loops of tests
Date: Mon, 15 Aug 2005 15:10:32 -0700
User-agent: Mutt/1.5.6i

On Mon, Aug 15, 2005 at 06:26:29PM +0200, Ralf Wildenhues wrote:
> Currently, AT_CHECK(cmd, ignore, , , fail_commands)
> is somewhat superfluous, as fail_commands will never get executed
> because we ignore the return value.  The patch below changes that.
> I regard this change in semantics as ok because of the nonsensical
> behavior this combination had before, IMVHO.

AFAICS, fail_commands would run if cmd has a non-empty stdout or stderr.

> ### snip loop.at ###
> dnl autom4te -l autotest loop.at > loop; chmod +x loop; ./loop
> m4_define([AT_PACKAGE_STRING],[loop])
> m4_define([AT_PACKAGE_BUGREPORT],[devnull])
> AT_INIT
> AT_SETUP([loop])
> AT_CAPTURE_FILE([failures])
> for i in '' one '' two '' three; do
>   dnl Stylistic issue: we overwrite `failures' here to avoid quadratic
>   dnl growth of `testsuite.log' in the number of failures.
>   dnl This is because many tests might fail for the same reason.
>   AT_CHECK([test -z "$i"], ignore,ignore,ignore, [echo "$i" > failures])

Does replacing with this obviate the need for your patch?

AT_CHECK([test -z "$i" || echo "$i" >failures], ignore, ignore, ignore)

> done
> 
> dnl next command generates the real failure:
> AT_CHECK([test -s failures],1,ignore,ignore)

This does look like a sound technique for testing many variations of a command.

> AT_CLEANUP
> ### snip ###




reply via email to

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