RE: testing File::Finder
On 18 December 2003 21:44 Randal L. Schwartz wrote: 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. :) Another thing to bear in mind ... is this a Unix-like only module? If not, then symlinks will be a no go. Win32 doesn't support them, and I would imagine there are other OSs in the same position. Computing ownership on Win32 can be done via the Win32::LoginName(), Win32::NetAdmin::LocalGroupGetMembers() and Win32::NetAdmin::GroupGetMembers() functions if you wanted a separate Win32 test script, otherwise as soon as you start calling Unixy admin programs your distribution will likely get labelled (wrongly) under CPAN testing as 'NA' on other OSs. Barbie. -- Barbie (@missbarbell.co.uk) | Birmingham Perl Mongers | http://birmingham.pm.org/
Re: testing File::Finder
Barbie == Barbie [EMAIL PROTECTED] writes: Barbie Another thing to bear in mind ... is this a Unix-like only Barbie module? If not, then symlinks will be a no go. Win32 doesn't Barbie support them, and I would imagine there are other OSs in the Barbie same position. It's not my intention to make this unix-only. It's a wrapper around File::Find, so it should work anywhere File::Find works. I'll look at the way File::Find tests itself for portability guidence. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL: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!
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] URL: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] URL: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