AFS-PAG
view release on metacpan or search on metacpan
t/lib/Test/RRA.pm view on Meta::CPAN
# The special logic here is based on Test::More and is required to get the
# imports to happen in the caller's namespace.
#
# $module - Name of the module to load
# @imports - Any arguments to import, possibly including a version
#
# Returns: undef
sub use_prereq {
my ($module, @imports) = @_;
# If the first import looks like a version, pass it as a bare string.
my $version = q{};
if (@imports >= 1 && $imports[0] =~ m{ \A \d+ (?: [.][\d_]+ )* \z }xms) {
$version = shift(@imports);
}
# Get caller information to put imports in the correct package.
my ($package) = caller;
# Do the import with eval, and try to isolate it from the surrounding
# context as much as possible. Based heavily on Test::More::_eval.
t/lib/Test/RRA.pm view on Meta::CPAN
DESC is a description of the tests being skipped. A space and C<normally
skipped> will be appended to it and used as the skip reason.
=item use_prereq(MODULE[, VERSION][, IMPORT ...])
Attempts to load MODULE with the given VERSION and import arguments. If
this fails for any reason, the test will be skipped (by calling C<plan
skip_all> from Test::More) with a skip reason saying that MODULE is
required for the test.
VERSION will be passed to C<use> as a version bareword if it looks like a
version number. The remaining IMPORT arguments will be passed as the
value of an array.
=back
=head1 AUTHOR
Russ Allbery <eagle@eyrie.org>
=head1 COPYRIGHT AND LICENSE
t/lib/Test/RRA/Config.pm view on Meta::CPAN
print "Required Perl version is $MINIMUM_VERSION\n";
=head1 DESCRIPTION
Test::RRA::Config encapsulates per-package configuration for generic Perl
test programs that are shared between multiple packages using the
rra-c-util infrastructure. It handles locating and loading the test
configuration file for both C Automake packages and stand-alone Perl
modules.
Test::RRA::Config looks for a file named F<data/perl.conf> relative to the
root of the test directory. That root is taken from the environment
variables BUILD or SOURCE (in that order) if set, which will be the case
for C Automake packages using C TAP Harness. If neither is set, it
expects the root of the test directory to be a directory named F<t>
relative to the current directory, which will be the case for stand-alone
Perl modules.
The following variables are supported:
=over 4
( run in 0.401 second using v1.01-cache-2.11-cpan-64827b87656 )