Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi,
I personally think that creating 't/data/mytesdata.dat' and locating it in the test script as './t/data/mytesdata.dat' is fine. However, I've struck at least one person who expects the test scripts to be runnable from both the top-level and the 't' directories. I have no time for that viewpoint, though I pander to it if I think of it (and can be bothered). IMO, the test suite is designed to be run by 'make test', which means the cwd will be the directory that contains the Makefile (and the Makefile.PL). If one subsequently needs to run any test scripts outside of the 'make test' process, then one ought to understand that limitations may exist wrt to the location from which the scripts are run (as would be the case with your proposed layout). Rather than unlink any files, I prefer to have the 'make clean' step remove them - which can be achieved by specifying the 'clean' option in WriteMakefile() in the Makefile.PL: It annoys me when I want to inspect the contents of a certain file, only to find that the test script that created that file has also removed it. There also exist on CPAN some annoying test scripts where the attempts to unlink certain files fail (though these files could be successfully removed by 'make clean' if they were specified in the 'clean' option). Cheers, Rob In reply to Re: CPAN test scripts, "run" directory, and test data files
by syphilis
|
|