bug-findutils
[Top][All Lists]
Advanced

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

Contributing findutils test cases


From: James Youngman
Subject: Contributing findutils test cases
Date: Thu, 6 Jan 2005 00:15:49 +0000
User-agent: Mutt/1.3.28i

On Thu, Jan 06, 2005 at 01:45:28AM +0300, Dmitry V. Levin wrote:

> Well, I have some spare time which could be used to help you with this task.
> I maintain findutils package for ALT's development repository since 4.1.1,
> so I can use this user base to test experimental features.

Since 4.1.1 is a long time now - even release 4.1.7 is over ten years
old.  You probably have more experience with the findutils code base
than I do.  Many thanks for your offer of help!

I would be very grateful for any help.  The test cases we need are not
tests for experimental features, but instead test cases for the
existing functionality of "xargs" so that they can be used as
regression tests.  The idea is to detect any breakage of xargs (or, I
suppose, anything else) as I'm refactoring the code.

> Unfortunately, I'm not familiar with tcl and dejagnu.  The testsuit
> in coreutils (written in shell+perl) looks more clear for me.

I agree - for this reason, the (extensive) test suite for GNU CSSC is
a large bunch of shell scripts (with use of support functions).

Anyway, findutils has a Dejagnu test suite, and so it seems reasonable
to work with what I have already, even though like you I don't think
it's ideal.

In terms of how the test suite for xargs goes, it seems fairly simple.
The directories xargs.{posix,sysv,gnu} contain tests which relate to
the standard POSIX xargs functionality, the SYSV functionality and the
GNU extensions respectively.  Taking xargs.gnu as our example, each
test consists of three files.  The first two are in in xargs.gnu; for
example 0n3.exp is the "driver" of the test and contains the command
line to be passed to xargs.  The file 0n3.xo contains the expected
output.  The file 0n3.exp indicates that the input file is files0.xi,
which can be found at ../inputs/files0.xi.   

Dejagnu will execute the specified xargs command, passing the spefieid
input file as standard input, and check the resulting output on stdout
against the contents of the "0n3.xo" file.  If they match, it
considers the test to have passed.

By default, Dejagnu will run all the "*.exp" files in these
directories.  To ensure they are also shipped with the findutils
distribution, you would need to add the names of any new files to
findutils/xargs/testsuite/Makefile.am (in $EXTRA_DIST).

To run the test suite, use "make check" - to do this just for xargs,
do it in the "xargs" subdirectory.  The "find" test suite is somewhat
similar, though it doesn't have sample input files; instead, the *.exp
files set up a small directory hierarchy which is then searched.  

I hope this is a clear enough description to enable you to think
seriously about helping; in case it is useful for anybody else, I'm
CCing this to the mailing list.

Regards and thanks again,
James.







reply via email to

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