Re: AT_CHECK within for loop

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

 



On 01/27/2011 05:20 PM, Daily, Jeff A wrote:
> In a nutshell, I've written a drop-in replacement of another tool and would like to test that it functions identical to the original.  All you need to know about these tools is that they take as input one or more binary files and produce a single binary file.  Of course they do more than that, but the details aren't important.  Also, in order to compare the binary output files, I've written another tool "pgcmp".
> 
> The input files are stored in a data directory.  The number of files in this directory can change.  It'd like to perform the same tests against every input file in the data directory, but have the ability to skep files which might not meet some sort of criteria.  Something like:
> 
> 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
> AT_CLEANUP
> 
> Is this allowed/okay?

Absolutely!  AT_CHECK is just a macro that expands to shell code; it is
perfectly legal to surround it by additional shell code that adds
conditions on whether the AT_CHECK will be reached.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux