++ed by:

1 non-PAUSE user.

Jens Berthold


Dist::Zilla::Plugin::Test::Inline - Create test files from inline tests in POD sections


version 0.011005


In your dist.ini:


In your module:

        # My/AddressRange.pm

        =begin testing

        use Test::Exception;
        dies_ok {
                My::AddressRange->list_from_range('10.2.3.A', '')
        } "list_from_range() complains about invalid address";

        =end testing
        sub list_from_range {
                # ...

This will result in a file t/inline-tests/my_addressrange.t in your distribution.


This plugin integrates Test::Inline into Dist::Zilla.

It scans all non-binary files in the lib path of your distribution for inline tests in POD sections that are embedded between the keywords

        =begin testing
        =end testing

These tests are then exported into t/inline-tests/*.t files when Dist::Zilla builds your module. Multiple of test sections may be specified within one file.

Please note that this plugin (in contrast to pure Test::Inline) can also handle Moops-like class and role definitions.

Files to be scanned for inline tests

Only files already gathered by previous file gatherer plugins are scanned. In other words: tests will not be extracted for files which have been excluded.


        exclude_match = Hidden\.pm

This will lead to Dist::Zilla::Plugin::Test::Inline ignoring Hidden.pm.



Required by role Dist::Zilla::Role::FileGatherer.

Searches for inline test code in POD sections using Test::Inline, creates in-memory test files and passes them to Dist::Zilla.


Required by role Dist::Zilla::Role::PrereqSource.

Adds Test::More to the list of prerequisites (as Test::Inline inserts use Test::More;) for the distribution that uses this plugin.


The code of this Dist::Zilla file gatherer plugin is based on https://github.com/moose/moose/blob/master/inc/ExtractInlineTests.pm.

  • Dave Rolsky <autarch@urth.org>, who basically wrote most of this but left the honor of making a plugin out of it to me ;-)


Jens Berthold <jens.berthold@jebecs.de>


This software is copyright (c) 2015 by Jens Berthold.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.