Fennec::Finder(3pm)
π Fennec::Finder β the manual page, bestie edition π
So this is Fennec::Finder(3pm) from the User Contributed Perl Documentation section, and it's genuinely giving "one file to rule them all" energy. β¨
π NAME π
Fennec::Finder β create one .t file to find all .pm test files. That's it. That's the whole vibe. π
πΈ DESCRIPTION πΈ
Okay so storytime: back in the day, Fennec used to use a runner that got loaded up inside t/Fennec.t and that runner went hunting around for test files (aka modules) to run. Cute, but a lot.
This module does the same kinda thing but greatly simplified β like, same job, way less drama. π¦
β¨ SYNOPSIS β¨
Your Fennec.t should look like this, no cap:
#!/usr/bin/perl
use strict;
use warnings;
use Fennec::Finder;
run();
So what does that actually do? It finds all the .pm and .ft files chilling under t/ and loads them. π Any of those files that contain Fennec tests will register themselves to be run the moment you call run(). Iconic behaviour honestly.
β οΈ Warning bestie, read this one: if you've got.pmfiles sitting int/that are not tests, they're gonna get loaded too. And if any of those have interactions with the packages you're testing, you must account for them. Not me warning you about your own directory layout π
π CUSTOMISATIONS π
π SEARCH PATHS π
When you do use Fennec::Finder;, the ./t/ directory gets searched if it exists. If it doesn't? Then ./ gets used instead. Simple as that. π«Ά
But you can optionally hand it alternate paths at use time, like:
use Fennec::Finder './Fennec', './SomeDir';
And in context, it looks like this:
#!/usr/bin/perl
use strict;
use warnings;
use Fennec::Finder './Fennec', './SomeDir';
run();
Look at you, customising. π
β FILE VALIDATION β
Wanna control which files actually get loaded? Say less. You can subclass Fennec::Finder and override the validate_file( $file ) method. π§
Here's the tea on how it works:
- It takes the filename to verify as an argument. π
- Return true if the file should be loaded.
- Return false if it should not.
And currently? The only check it does is that the filename ends with a ".pm". That's it. That's the whole validation. Lowkey minimal, highkey works. π
π 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. π«‘
And that's the whole page, bestie β you ate it. πβ¨
This little gem is documented as part of perl v5.36.0, dated 2022-12-02, and it's Fennec::Finder(3pm) β so go forth, make that one .t file, and let it find all your .pm test files for you. Slay. ππ¦π
π¦ where this page comes from
- debian bookworm: libfennec-perl 2.018-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libfennec-perl 2.018-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libfennec-perl 2.018-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libfennec-perl 2.018-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libfennec-perl 2.018-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms