Fennec::Finder - Create one .t file to find all .pm test files.
Originally Fennec made use of a runner loaded in t/Fennec.t that sought out test files (modules) to run. This modules provides similar, but greatly simplified functionality.
Fennec.t:
#!/usr/bin/perl use strict; use warnings; use Fennec::Finder; run();
This will find all .pm and .ft files under t/ and load them. Any that contain Fennec tests will register themselves to be run once run() is called.
Warning, if you have .pm files in t/ that are not tests they will also be loaded, if any of these have interactions with the packages you are testing you must account for them.
When you use Fennec::Finder; the './t/' directory will be searched if it exists, otherwise the './' directory will be used. You may optionally provide alternate paths at use time: use Fennec::Finder './Fennec', './SomeDir';
use Fennec::Finder;
use Fennec::Finder './Fennec', './SomeDir';
#!/usr/bin/perl use strict; use warnings; use Fennec::Finder './Fennec', './SomeDir'; run();
If you wish to customize which files are loaded you may subclass Fennec::Finder and override the validate_file( $file ) method. This method takes the filename to verify as an argument. Return true if the file should be loaded, false if it should not. Currently the only check is that the filename ends with a .pm.
validate_file( $file )
.pm
Chad Granum exodist7@gmail.com
Copyright (C) 2013 Chad Granum
Fennec is free software; Standard perl license.
Fennec is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
To install Fennec, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Fennec
CPAN shell
perl -MCPAN -e shell install Fennec
For more information on module installation, please visit the detailed CPAN module installation guide.