File: launch.t

package info (click to toggle)
libdevel-cover-perl 1.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,036 kB
  • sloc: perl: 10,861; sh: 687; makefile: 7
file content (36 lines) | stat: -rw-r--r-- 815 bytes parent folder | download | duplicates (6)
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
27
28
29
30
31
32
33
34
35
36
use strict;
use warnings;

use Test::More;

opendir my $d, 'lib/Devel/Cover/Report';
my @reporters = grep { s/\.pm$// } readdir($d);
closedir $d;

{
    local $SIG{__WARN__} = sub {};
    eval "use HTML::Entities; 1";
    if ($@) {
        plan skip_all => "No HTML::Entities";
        exit;
    }
}

plan tests => scalar @reporters;

my @reporters_with_launch = qw(
    Html Html_basic Html_minimal Html_subtle
);

# Check that the expected reporters support the launch feature
for my $reporter (@reporters) {
    my $class = 'Devel::Cover::Report::' . $reporter;
    eval "require $class";

    if (grep { $_ eq $reporter } @reporters_with_launch) {
        ok($class->can('launch'), "$reporter supports launch");
    }
    else {
        ok(! $class->can('launch'), "$reporter does not support launch");
    }
}