Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src
On Mon, Jul 05, 2010 at 02:10:12PM +0100, Julio Merino wrote:
> On Mon, Jul 5, 2010 at 1:53 PM, Nicolas Joly <njoly%netbsd.org@localhost>
> wrote:
> > Module Name: src
> > Committed By: njoly
> > Date: Mon Jul 5 12:53:59 UTC 2010
> >
> > Modified Files:
> > src/distrib/sets/lists/tests: mi
> > src/etc/mtree: NetBSD.dist.base
> > src/tests/fs: Makefile
> > Added Files:
> > src/tests/fs/vfs: Atffile Makefile t_rmdirrace.c
> >
> > Log Message:
> > Add test program that use sample code from kern/41937, and fs rump
> > helpers to check currently supported filesystems.
> >
> > t_rmdirrace (1/1): 5 test cases
> > ext2fs_race: Passed.
> > ffs_race: Passed.
> > msdosfs_race: Passed.
> > sysvbfs_race: Passed.
> > tmpfs_race: Passed.
>
> Neat!
>
> But one suggestion: test programs should have a generic name whereas
> the test cases should carry the more specific name. This makes it
> possible to reuse a test program to provide several test cases and,
> therefore, reduces the burden of adding new test programs every time
> we want to test something.
>
> In this particular case, it'd have made sense (imo) to name the test
> program "t_rmdir" and the test case "race". This way, t_rmdir can
> very easily accommodate future tests for rmdir(2) without the need to
> create a test program -- and adding a single test case is trivial, but
> adding a test program currently is not.
The main idea behind this was to have, except for the exercizing code,
a one liner test.
func() {}
ATF_FSAPPLY(func, "func description")
Not using the ATF_FSAPPLY macro, it becomes :
func() {}
ATF_TC_FSAPPLY(func, "description")
ATF_TP_ADD_TCS(tp)
{
ATF_TP_FSAPPLY(func);
return atf_no_error();
}
Which may be more convenient to add further testcases.
--
Nicolas Joly
Biological Software and Databanks.
Institut Pasteur, Paris.
Home |
Main Index |
Thread Index |
Old Index