Chad Granum > Fennec-2.017 > Fennec::Finder

Download:
Fennec-2.017.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source  

NAME ^

Fennec::Finder - Create one .t file to find all .pm test files.

DESCRIPTION ^

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.

SYNOPSIS ^

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.

CUSTOMISATIONS ^

SEARCH PATHS

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';

    #!/usr/bin/perl
    use strict;
    use warnings;

    use Fennec::Finder './Fennec', './SomeDir';

    run();

FILE VALIDATION

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.

AUTHORS ^

Chad Granum exodist7@gmail.com

COPYRIGHT ^

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.

syntax highlighting: