Dist::Zilla::Plugin::Test::Compile - common tests to check syntax of your modules
version 2.014
In your dist.ini:
[Test::Compile]
skip = Test$
fake_home = 1
needs_display = 1
fail_on_warning = author
bail_out_on_fail = 1
This is a plugin that runs at the gather files stage, providing the following files:
-
t/00-compile.t
- a standard test to check syntax of bundled modulesThis test will find all modules and scripts in your dist, and try to compile them one by one. This means it's a bit slower than loading them all at once, but it will catch more errors.
We currently only check
bin/
,script/
andscripts/
for scripts.
This plugin accepts the following options:
- skip: a regex to skip compile test for modules matching it. The
match is done against the module name (
Foo::Bar
), not the file path (lib/Foo/Bar.pm
). This option can be repeated to specify multiple regexes. - fake_home: a boolean to indicate whether to fake
$ENV{HOME}
. This may be needed if your module unilateraly creates stuff in homedir: indeed, some cpantesters will smoke test your dist with a read-only home directory. Default to false. - needs_display: a boolean to indicate whether to skip the compile test
on non-Win32 systems when
$ENV{DISPLAY}
is not set. Defaults to false. - fail_on_warning: a string to indicate when to add a test for
warnings during compilation checks. Possible values are:
-
none: do not check for warnings
-
author: check for warnings only when AUTHOR_TESTING is set (default, and recommended)
-
all: always test for warnings (not recommended, as this can prevent installation of modules when upstream dependencies exhibit warnings in a new Perl release)
-
module_finder
This is the name of a FileFinder for finding modules to check. The default value is
:InstallModules
; this option can be used more than once. .pod files are always omitted.Other pre-defined finders are listed in FileFinder. You can define your own with the Dist::Zilla::Plugin::FileFinder::ByName plugin.
-
script_finder
Just like
module_finder
, but for finding scripts. The default value is:ExecFiles
(you can use the Dist::Zilla::Plugin::ExecDir plugin to mark those files as executables).
-
- bail_out_on_fail: a boolean to indicate whether the test will BAIL_OUT of all subsequent tests when compilation failures are encountered. Defaults to false.
You can also look for information on this module at:
-
AnnoCPAN: Annotated CPAN documentation
-
CPAN Ratings
http://cpanratings.perl.org/d/Dist-Zilla-Plugin-Test-Compile
-
Open bugs
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dist-Zilla-Plugin-Test-Compile
-
Git repository
http://github.com/jquelin/dist-zilla-plugin-test-compile.git.
Jerome Quelin
This software is copyright (c) 2009 by Jerome Quelin.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
- Ahmad M. Zawawi <azawawi@ubuntu.(none)>
- Chris Weyl cweyl@alumni.drew.edu
- Harley Pig harleypig@gmail.com
- Jerome Quelin jquelin@gmail.com
- Jesse Luehrs doy@tozt.net
- Karen Etheridge ether@cpan.org
- Kent Fredric kentfredric@gmail.com
- Marcel Gruenauer hanekomu@gmail.com
- Olivier Mengué dolmen@cpan.org
- Randy Stauner randy@magnificent-tears.com
- Ricardo SIGNES rjbs@cpan.org
- fayland fayland@gmail.com