[Top][All Lists]

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

Re: AT_CHECK within for loop

From: Eric Blake
Subject: Re: AT_CHECK within for loop
Date: Fri, 28 Jan 2011 10:57:44 -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/28/2011 10:49 AM, Joel E. Denny wrote:
>>> AT_SETUP([testing $file, no arguments])
>>> for file in $datadir/*
>>> do
>>>     AS_IF([bad $file], [continue])
>>>     AT_CHECK([replacement $file -o replacement.out])
>>>     AT_CHECK([original $file -o original.out])
>>>     AT_CHECK([pgcmp replacement.out original.out])
>>> done

Single test, with multiple checks.

> In my experience, that's true for AT_CHECK, but it isn't true for AT_SETUP 
> and AT_CLEANUP.  In that case, the loop must be written using m4 
> constructs not shell constructs.  Because I speak shell more easily than 
> m4, I'd be happy to hear that I'm wrong.

Unfortunately correct - if you want multiple tests (that is, where you
can run a subset of the testsuite using just testsuite arguments, rather
than hacking the 'bad' script filter in that initial AS_IF of the
example above), then you must surround AT_SETUP inside an m4 loop to
repeat its expansion once per test.

It's a tradeoff of the level of test granularity you want; also, using
an m4 loop to expand AT_SETUP multiple times creates a larger testsuite,
so you don't gain from the compactness of a shell loop.

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]