File: pod_coverage.t

package info (click to toggle)
libtest-assertions-perl 1.054-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 148 kB
  • ctags: 31
  • sloc: perl: 562; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 1,024 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/local/bin/perl

use Test::More;
use File::Spec;
use lib './lib';

eval "use Test::Pod::Coverage 1.00";
plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD Coverage" if($@);

# dir may be zero length on win32 (indicating current directory)
my $dir = File::Spec->catdir
    ( (File::Spec->splitpath($0))[1], File::Spec->updir());
if(defined $dir && length $dir) {
    chdir($dir) or die "Couldn't change to project dir ($dir)";
}

#AppsIflRunner is a wrapper around ModperlRunner and CGIRunner, so its interface is documented in those modules
@modules = grep {$_ !~ /^AppsIflRunner$/} Test::Pod::Coverage::all_modules() or plan skip_all => "No modules to test";

plan tests => scalar @modules;
for my $module (@modules) {
    my @private = (qr/^[A-Z_]+$/);
    @private = (qr/^tests$/, qr/^ASSERT_/, qr/^TRACE|HAVE_ALARM$/) if($module eq 'Test::Assertions');
    @private = (qr/^deep_import$/) if($module eq 'Log::Trace');
    pod_coverage_ok($module, { also_private => \@private }); #Ignore all caps
}