testing File::Finder
In my recently released File::Finder module, I have the basic tests to ensure that the find options are grabbed correctly, and that the core and/or/not/parens logic is clean, along with the easy test to ensure that eval() works. However, to test the file operations, like "files named moe", I have to test a live file tree. Or do I? I was hoping to leverage off the tests for find2perl, because that's exactly what I'd be testing as well. Alas, none. The tests for File::Find are rather simple, because there it's more about the mechanism and the odd cases (like symlinks) than about individual file properties. Should my test come with a tar file that gets extracted? Should I build a small tree on the fly? Any thoughts would be appreciated. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: testing File::Finder
On Thu, Dec 18, 2003 at 01:28:57PM -0800, Randal L. Schwartz wrote: > In my recently released File::Finder module, I have the basic > tests to ensure that the find options are grabbed correctly, > and that the core and/or/not/parens logic is clean, along with > the easy test to ensure that eval() works. > > However, to test the file operations, like "files named moe", I have > to test a live file tree. Or do I? > > I was hoping to leverage off the tests for find2perl, because that's > exactly what I'd be testing as well. Alas, none. The tests for File::Find > are rather simple, because there it's more about the mechanism and > the odd cases (like symlinks) than about individual file properties. > > Should my test come with a tar file that gets extracted? Should I > build a small tree on the fly? If you're not planning on your tests modifying the test tree at all, you can probably just get away with having t/tree/... as a bunch of normal files and directorys in the tarball. Don't ship a seperate tar file, that introduces unnecessary dependencies. If you plan on making changes to the tree you'll need some way to setup/teardown the tree between test runs to ensure its clean. In that case a tarball or small perl script would be best. -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.com/~schwern/ I've just gone through a lung-crushing breakup with my blender and I don't think I should screw my forehead alone tonight.
Re: testing File::Finder
> "Michael" == Michael G Schwern <[EMAIL PROTECTED]> writes: Michael> If you're not planning on your tests modifying the test tree at all, Michael> you can probably just get away with having t/tree/... as a bunch of Michael> normal files and directorys in the tarball. Don't ship a seperate Michael> tar file, that introduces unnecessary dependencies. oh. duh. Yeah, that makes great sense. I can add local symlinks and hardlinks. I'll compute ownership out-of-band and compare it to the test result though... I wouldn't want someone extracting this as joebloe to fail because the uid wasn't root. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: testing File::Finder
Op een winterige herfstdag (Thursday 18 December 2003 22:44), schreef Randal L. Schwartz: > > "Michael" == Michael G Schwern <[EMAIL PROTECTED]> writes: > > Michael> If you're not planning on your tests modifying the test tree at > all, Michael> you can probably just get away with having t/tree/... as a > bunch of Michael> normal files and directorys in the tarball. Don't ship a > seperate Michael> tar file, that introduces unnecessary dependencies. > > oh. duh. Yeah, that makes great sense. I can add local symlinks > and hardlinks. Oh yeah, that's just great! Exclude all them poor Win32 users! Please stick to the advice Schwern gave and ship with a true directory tree (or a script that creates one) for your testing! > I'll compute ownership out-of-band and compare it > to the test result though... I wouldn't want someone extracting > this as joebloe to fail because the uid wasn't root. :) what's 'root' ;-) Good luck, Abe -- "Jarkko Hietaniemi" is actually the code name for a whole team of Finnish super-programmers, capable of working continuously 25 hours a day without tripping each other up, and running solely only on intravenous caffeine. -- Nicholas Clark on p5p @ 2002-03-04
[ANNOUNCE] Devel::Cover 0.29
On Mon, Dec 01, 2003 at 01:45:22AM +0100, Paul Johnson wrote: People seem to be using this module. I keep getting bug reports, suggestions and even patches ;-) Changes in this release: - Merge data from files with identical MD5 checksums (Arthur Bergman). - Add do test. - Handle $x || return. - Keep cover -delete happy when there is no existing database. - In cover, make -file a glob and add -exclude. - Watch for coverage options being set in cover (PERL5OPT set?). - Fix up html_basic and html_subtle. - Make 5.6.x builds a bit quieter. - Clean up time routines in XS code. The last change means that this release might have a better chance of working on Win32 systems. If anyone is able to try that, and optionally fix any problems, I'd be grateful. As usual, available from CPAN soon or my homepage now. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net
