Test::K...e::Extra(3)
π Test::Kwalitee::Extra β the manual, but make it cute π
okay bestie so this is the Test::Kwalitee::Extra page from the User Contributed Perl Documentation section (section 3, iykyk), and honestly? it's giving "your distribution's vibe check, but automated." sit down, grab a boba, we're doing this. π§β¨
β¨ VERSION β¨
version v0.4.0 β yes she's on v0.4.0, keep up π
π SYNOPSIS π
okay so here's the whole vibe, copy-paste ready:
# Simply use, with excluding indicators
use Test::Kwalitee::Extra qw(!has_example !metayml_declares_perl_version);
# Use with eval guard, with excluding class
use Test::More;
eval { require Test::Kwalitee::Extra; Test::Kwalitee::Extra->import(qw(!:optional)); };
plan( skip_all => "Test::Kwalitee::Extra not installed: $@; skipping") if $@;
# Typically, this test is limited to author test or release test
BEGIN { # limited to release test
unless ($ENV{RELEASE_TESTING}) { # or $ENV{AUTHOR_TESTING} for author test
require Test::More;
Test::More::plan(skip_all => 'these tests are for release candidate testing');
}
}
use Test::More;
eval { require Test::Kwalitee::Extra; Test::Kwalitee::Extra->import(qw(!:optional)); };
plan( skip_all => "Test::Kwalitee::Extra not installed: $@; skipping") if $@;
# Avoid network access
use Test::Kwalitee::Extra qw(!prereq_matches_use);
# or, when experimental enabled
use Test::Kwalitee::Extra qw(:experimental !prereq_matches_use !build_prereq_matches_use);
notice how we're using $ENV{RELEASE_TESTING} and $ENV{AUTHOR_TESTING} there? those are the vibes-gates, bestie. π«Ά
π DESCRIPTION π
okay so let's set the scene. CPANTS (<http://cpants.cpanauthors.org/>) checks these things called Kwalitee indicators. and no, Kwalitee is not quality β it's literally just "automatically-measurable indicators how good your distribution is." the spelling with a K is intentional, we're being cute about it. π
Module::CPANTS::Analyse is the thing that calcluates Kwalitee (yes, the original says "calcluates", we're keeping the typo, it's part of the lore now) β but plot twist: it is not directly applicable to your module test. and CPAN has already had Test::Kwalitee for the test module of Kwalitee, iconic behaviour honestly.
BUT. here's the problem bestie. it is impossible to calculate the "prereq_matches_use" indicator, because the dependent module Module::CPANTS::Analyse itself cannot calculate the "prereq_matches_use" indicator. it's marked as "needs_db" which means a pre-calculated module database is necessary... except only limited information is actually needed to calculate the indicator. so annoying. π
so this module β the one you're reading about right now β calculates "prereq_matches_use" by querying the needed information to MetaCPAN site (<https://metacpan.org/>) online. yes. network access. we'll get to that in CAVEATS, hold that thought. π
for available indicators, see the "INDICATORS" section. it's a whole journey down there. π¦
π OPTIONS π
so you can specify including or excluding an indicator or a tag, like Exporter does. valid tags are "core", "optional" and "experimental". for indicators, see Module::CPANTS::Analyse.
Please NOTE that specifying tags is handled a bit differently from Exporter. read this part twice, bestie, it's the plot twist.
First: specifying an indicator is always superior to specifying tags, even though specifying an indicator is prior to specifying tags. wait that sentence is a little cursed but it's exactly what the manpage says so we're keeping it fr fr.
for example:
use Test::Kwalitee::Extra qw(!has_example :optional);
"!has_example" is in effect β that is, "has_example" is excluded β even though "has_example" is an "optional" indicator. the ! wins. always. periodt. π
Second: default excluded indicators mentioned in the "INDICATORS" section are not included by specifying tags. so in the above example, ":optional" does not enable "is_prereq". sneaky, right? π you can override it by explicitly specifying the indicator:
use Test::Kwalitee::Extra qw(manifest_matches_dist);
πΈ SPECIAL TAGS πΈ
some tags have special meanings. they're the main characters of this section, lowkey.
β ":no_plan"
if specified, do not call "Test::Builder::plan". you may need to specify it if this test is embedded into other tests. that's it, that's the whole tag. simple queen. π
π¦ ":minperlver" <"version">
so the "prereq_matches_use" indicator ignores core modules. but what counts as core is different among perl versions β highkey chaotic of perl, but okay.
if a minimum perl version is specified in META.yml or such a meta information, it is used as the minimum perl version. otherwise, $] β the version of the current perl interpreter β is used.
if specified, this option overrides them. so you get to be the boss. πͺ
π ":retry" <"count">
the number of retries to query to MetaCPAN. this is related with the "prereq_matches_use" and "build_prereq_matches_use" indicators only.
defaults to 5. five chances, because we're generous. π«Ά
π CAVEATS π
okay bestie, listen up, this is the important part.
an optional indicator "prereq_matches_use" and an experimental indicator "build_prereq_matches_use" require HTTP access to MetaCPAN site (<https://metacpan.org/>). network. actual network. π¨
if you want to avoid it, you can specify excluded indicators like:
# Avoid network access
use Test::Kwalitee::Extra qw(!prereq_matches_use);
# or, when experimental enabled
use Test::Kwalitee::Extra qw(:experimental !prereq_matches_use !build_prereq_matches_use);
or, if you'd rather just mitigate the wait, you can do it by tentative failures to reduce retry counts like:
# Try just one time for each query
use Test::Kwalitee::Extra qw(:retry 1);
one (1) attempt. manifesting. β¨
π INDICATORS π
in Module::CPANTS::Analyse, "prereq_matches_use" requires a CPANTS DB setup by Module::CPANTS::ProcessCPAN. meanwhile "is_prereq" really requires information of prereq of other modules, but "prereq_matches_use" only needs mappings between modules and dists. so, this module queries the mappings to MetaCPAN by using MetaCPAN::Client. slay. π
recently, Module::CPANTS::Analyse has been changed much. for actual available indicators, please consult the "Module::CPANTS::Kwalitee::*" documentation. for default configuration, indicators are treated as follows:
π NOTES π
- (+) β no longer available for
Module::CPANTS::Analyse0.88or0.90+. - (++) β no longer available for
Module::CPANTS::Analyse0.90+. - (+++) β no longer available for
Module::CPANTS::Analyse0.88or0.90+, moved toModule::CPANTS::SiteKwalitee(<https://github.com/cpants/Module-CPANTS-SiteKwalitee>). - (++++) β no longer available for
Module::CPANTS::Analyse0.88or0.90+, moved toModule::CPANTS::SiteKwalitee(<https://github.com/cpants/Module-CPANTS-SiteKwalitee>) but supported by this module.
π Available indicators in core
has_readmehas_manifesthas_meta_ymlhas_buildtoolhas_changelogno_symlinkshas_testsbuildtool_not_executable(++)metayml_is_parsablemetayml_has_license(optional for0.88or0.90+)metayml_conforms_to_known_specproper_libs(for0.87or0.89)no_pod_errors(+)has_working_buildtool(+)has_better_auto_install(+)use_strictvalid_signature(+++)has_humanreadable_license(for0.87or0.89) |has_human_redable_license(for0.88or0.90+) β yes,redable, that's the actual spelling in there, we are NOT fixing it πno_cpants_errors(+)
πΈ Available indicators in optional
has_tests_in_t_dirhas_example(+)no_stdin_for_promptingmetayml_conforms_spec_currentmetayml_declares_perl_versionprereq_matches_use(++++)use_warningshas_test_pod(+)has_test_pod_coverage(+)
π« Excluded indicators in core
Can not apply already unpacked dist
extractable(+)extracts_nicely(+)has_version(+)has_proper_version(+)
Already dirty in test phase
manifest_matches_distno_generated_files(++)
π« Excluded indicators in optional
Can not apply already unpacked dist
proper_libs(for0.88or0.90+)
Needs CPANTS DB
is_prereq(+++)
π§ Indicators with special note in experimental
build_prereq_matches_use(++++)
π₯ SEE ALSO π₯
Module::CPANTS::Analyseβ Kwalitee indicators, except forprereq_matches_use, are calculated by this module.Test::Kwaliteeβ Another test module for Kwalitee indicators.Dist::Zilla::Plugin::Test::Kwalitee::Extraβ Dist::Zilla plugin for this module.
π«Ά AUTHOR π«Ά
Yasutaka ATARASHI <yakex@cpan.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2017 by Yasutaka ATARASHI.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie!! π this was rendered under perl v5.42.0 on 2025-07-25, from the Test::K...e::Extra(3) manpage (yes the title is truncated like that, it's giving cryptic, we love a mystery). go forth, run your Kwalitee tests, exclude what you need to exclude, and remember: no network access without consent πβ¨π
π¦ where this page comes from
- fedora 43: perl-Test-Kwalitee-Extra 0.4.0-26.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms