File Coverage

t/00-compile.t
Criterion Covered Total %
statement 34 36 94.4
branch 6 12 50.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 47 55 85.4


line stmt bran cond sub pod time code
1 1     1   16 use 5.006;
  1         2  
  1         30  
2 1     1   3 use strict;
  1         1  
  1         22  
3 1     1   3 use warnings;
  1         1  
  1         28  
4              
5             # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.040
6              
7 1 50   1   561 use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
  1         13334  
  1         10  
8              
9              
10              
11 1         4 my @module_files = (
12             'DateTimeX/ISO8601/Interval.pm'
13             );
14              
15              
16              
17             # no fake home requested
18              
19 1 50       11 my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
20              
21 1     1   352 use File::Spec;
  1         2  
  1         18  
22 1     1   466 use IPC::Open3;
  1         3104  
  1         50  
23 1     1   551 use IO::Handle;
  1         3790  
  1         1478  
24              
25 1 50       43 open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
26              
27 1         3 my @warnings;
28 1         2 for my $lib (@module_files)
29             {
30             # see L
31 1         8 my $stderr = IO::Handle->new;
32              
33 1         29 my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
34 1 50       2679 binmode $stderr, ':crlf' if $^O eq 'MSWin32';
35 1         148294 my @_warnings = <$stderr>;
36 1         31 waitpid($pid, 0);
37 1         19 is($?, 0, "$lib loaded ok");
38              
39 1 50       438 if (@_warnings)
40             {
41 0         0 warn @_warnings;
42 0         0 push @warnings, @_warnings;
43             }
44             }
45              
46              
47              
48 1 50       55 is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING};
49              
50