Test::Kwalitee::Extra - Run Kwalitee tests including optional indicators, especially, prereq_matches_use
version v0.0.6
# 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 $@;
CPANTS checks Kwalitee indicators, which is not quality but automatically-measurable indicators how good your distribution is. Module::CPANTS::Analyse calcluates Kwalitee but it is not directly applicable to your module test. CPAN has already had Test::Kwalitee for the test module of Kwalitee. It is, however, limited to 13 indicators from 34 indicators (core and optional), as of 1.01. Furthermore, Module::CPANTS::Analyse itself cannot calculate prereq_matches_use indicator. It is marked as needs_db, but only limited information is needed to calculate the indicator. This module calculate prereq_matches_use to query needed information to MetaCPAN.
prereq_matches_use
needs_db
Currently, 18 core indicators and 8 optional indicators are available in default configuration. See "INDICATORS" section.
You can specify including or excluding an indicator or a tag like Exporter. Valid tags are core, optional and experimental. For indicators, see Module::CPANTS::Analyse.
core
optional
experimental
Please NOTE that to specify tags are handled a bit differently from Exporter. First, specifying an indicator is always superior to specifying tags, even though specifying an indicator is prior to specifying tags. For example,
use Test::Kwalitee::Extra qw(!has_example :optional);
!has_example is in effect, that is has_exaple is excluded, even though has_example is an optional indicator.
!has_example
has_exaple
has_example
Second, default excluded indicators mentioned in "INDICATORS" section are not included by specifying tags. For example, in the above example, :optional does not enable is_prereq and metayml_conforms_spec_current. You can override it by explicitly specifying the indicator:
:optional
is_prereq
metayml_conforms_spec_current
use Test::Kwalitee::Extra qw(metayml_conforms_spec_current);
Some tags have special meanings.
:no_plan
If specified, do not call Test::Builder::plan. You may need to specify it, if this test is embedded into other tests.
Test::Builder::plan
:minperlver
version
prereq_matches_use indicator ignores core modules. What modules are in core, however, is different among perl versions. If minimum perl version is specified in META.yml or such a meta information, it is used as minimum perl version. Otherewise, $], the version of the current perl interpreter, is used.
$]
If specified, this option overrides them.
In Module::CPANTS::Analyse, prereq_matches_use requires CPANTS DB setup by Module::CPANTS::ProcessCPAN. is_prereq really requires information of prereq of other modules but prereq_matches_use only needs mappings between modules and dists. So, this module query the mappings to MetaCPAN by using MetaCPAN::API::Tiny.
For default configuration, indicators are treated as follows:
has_readme
has_manifest
has_meta_yml
has_buildtool
has_changelog
no_symlinks
has_tests
buildtool_not_executable
metayml_is_parsable
metayml_has_license
proper_libs
no_pod_errors
has_working_buildtool
has_better_auto_install
use_strict
valid_signature
has_humanreadable_license
no_cpants_errors
has_tests_in_t_dir
no_stdin_for_prompting
metayml_declares_perl_version
use_warnings
has_test_pod
has_test_pod_coverage
extractable
extracts_nicely
has_version
has_proper_version
fest_matches_dist
no_generated_files
metayml_conforms_to_known_spec
Module::CPANTS::Analyse - Kwalitee indicators, except for prereq_matches_use, are calculated by this module.
Test::Kwalitee - Another test module for Kwalitee indicators.
Yasutaka ATARASHI <yakex@cpan.org>
This software is copyright (c) 2013 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.
To install Test::Kwalitee::Extra, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Kwalitee::Extra
CPAN shell
perl -MCPAN -e shell install Test::Kwalitee::Extra
For more information on module installation, please visit the detailed CPAN module installation guide.