NAME

Test::XTFiles - standard interface for author tests to find files to check

VERSION

Version 0.001

SYNOPSIS

use Test::XTFiles;

my @files = Test::XTFiles->new->all_module_files;

DESCRIPTION

Author tests often iterate over the files of a distribution to check them. XT::Files is a standard interface that allows the author test to ask the distribution for all the files of a type, instead of guessing which files to check.

USAGE

all_executable_files

Returns a list of all the Perl scripts that should be tested. This includes tests, if the distribution added them. You should test them as you test Perl scripts.

This list can be useful for tests that test things like execute permission or the shebang line.

all_files

Returns all files that should be tested. A typical use case would be to test all files that contain Pod documentation as Pod can be, but doesn't have to be, included in scripts, modules, tests and, of course, pod files.

# all files with Pod in it
use Pod::Simple::Search;
my @files = grep { Pod::Simple::Search->new->contains_pod($_) }
    Test::XTFiles->new->all_files;

all_module_files

Returns a list of all Perl modules that should be tested.

Before using this method make sure that you really want to test only modules. Most tests should run against modules and scripts. It's often better to use the all_perl_files method instead.

all_perl_files

Returns a list of all Perl files that should be tested. That includes modules, scripts and, if the distribution added them, tests. Most author tests should probably iterate over this list.

all_pod_files

Returns a list of all Pod files. These are the files that end in .pod. This list does not contain script or modules that include a Pod documentation.

It's probably better to use the all_files method and check which files contain Pod.

all_test_files

Returns a list of all .t files to be tested, if added by the distribution.

files

Returns a list of all files to be tested as XT::Files::File objects.

SEE ALSO

XT::Files, XT::Files::File

SUPPORT

Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at https://github.com/skirmess/XT-Files/issues. You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

https://github.com/skirmess/XT-Files

git clone https://github.com/skirmess/XT-Files.git

AUTHOR

Sven Kirmess <sven.kirmess@kzone.ch>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018-2019 by Sven Kirmess.

This is free software, licensed under:

The (two-clause) FreeBSD License