File Coverage

blib/lib/Test/Alien/Synthetic.pm
Criterion Covered Total %
statement 23 25 92.0
branch 10 12 83.3
condition 3 3 100.0
subroutine 11 12 91.6
pod 7 7 100.0
total 54 59 91.5


line stmt bran cond sub pod time code
1             package Test::Alien::Synthetic;
2              
3 4     4   833 use strict;
  4         17  
  4         179  
4 4     4   25 use warnings;
  4         16  
  4         173  
5 4     4   96 use 5.008004;
  4         18  
6 4     4   36 use Test2::API qw( context );
  4         14  
  4         1720  
7              
8             # ABSTRACT: A mock alien object for testing
9             our $VERSION = '2.45'; # VERSION
10              
11              
12 33 100   33   157 sub _def ($) { my($val) = @_; defined $val ? $val : '' }
  33         440  
13              
14 14     14 1 12444 sub cflags { _def shift->{cflags} }
15 19     19 1 1330 sub libs { _def shift->{libs} }
16 2 100   2 1 1006 sub dynamic_libs { @{ shift->{dynamic_libs} || [] } }
  2         14  
17              
18             sub runtime_prop
19             {
20 0     0 1 0 my($self) = @_;
21             defined $self->{runtime_prop}
22             ? $self->{runtime_prop}
23 0 0       0 : {};
24             }
25              
26             sub cflags_static
27             {
28 2     2 1 383 my($self) = @_;
29             defined $self->{cflags_static}
30             ? $self->{cflags_static}
31 2 100       8 : $self->cflags;
32             }
33              
34             sub libs_static
35             {
36 2     2 1 373 my($self) = @_;
37             defined $self->{libs_static}
38             ? $self->{libs_static}
39 2 100       9 : $self->libs;
40             }
41              
42             sub bin_dir
43             {
44 8     8 1 1815 my $dir = shift->{bin_dir};
45 8 100 100     151 defined $dir && -d $dir ? ($dir) : ();
46             }
47              
48             1;
49              
50             __END__