NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
test_requires_from and dev-support test modules (Score:1)
Any thoughts on how you would support "optional", development support testing modules?
For example, in the documentation for Test::Pod::Coverage, it recommends putting the module requirements behind an eval and skip_all statement, so that you, as the developer, can ensure that your POD is covered, but the end user doesn't need to have the testing modules installed.
While I, as a developer may care that the documentation is complete, I, as an end user, do not.
There might be a better example than what I provide
Re:test_requires_from and dev-support test modules (Score:1)
The best method is to also put it behind a RELEASE_TESTING (or at the least AUTOMATED_TESTING) environment check.
Here's the pod check test that I use, which as far as I'm aware encapsulates the current best practice.
#!/usr/bin/perl
# Test that the syntax of our POD documentation is validuse strict;BEGIN {
$| = 1;
$^W = 1;
}
my @MODULES = ('Pod::Simple 3.07',
'Test::Pod 1.26',
);
# Don't run tests for installsuse Test::More;
unless ( $ENV{AUTOMATED_TESTING} or $ENV{RELEASE_TESTING} ) {
plan( skip_all => "Author tests not required for installation" );
}
# Load the testing modulesforeach my $MODULE ( @MODULES ) {
eval "use $MODULE";
if ( $@ ) {
$ENV{RELEASE_TESTING}
? die( "Failed to load required release-testing module $MODULE" )
: plan( skip_all => "$MODULE not available for testing" );
}
}
all_pod_files_ok();
Reply to This
Parent
Re: (Score:1)