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   785 use strict;
  4         13  
  4         143  
4 4     4   23 use warnings;
  4         11  
  4         135  
5 4     4   77 use 5.008004;
  4         17  
6 4     4   23 use Test2::API qw( context );
  4         8  
  4         1409  
7              
8             # ABSTRACT: A mock alien object for testing
9             our $VERSION = '2.46'; # VERSION
10              
11              
12 33 100   33   161 sub _def ($) { my($val) = @_; defined $val ? $val : '' }
  33         431  
13              
14 14     14 1 10810 sub cflags { _def shift->{cflags} }
15 19     19 1 1177 sub libs { _def shift->{libs} }
16 2 100   2 1 829 sub dynamic_libs { @{ shift->{dynamic_libs} || [] } }
  2         35  
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 333 my($self) = @_;
29             defined $self->{cflags_static}
30             ? $self->{cflags_static}
31 2 100       12 : $self->cflags;
32             }
33              
34             sub libs_static
35             {
36 2     2 1 304 my($self) = @_;
37             defined $self->{libs_static}
38             ? $self->{libs_static}
39 2 100       10 : $self->libs;
40             }
41              
42             sub bin_dir
43             {
44 8     8 1 1571 my $dir = shift->{bin_dir};
45 8 100 100     138 defined $dir && -d $dir ? ($dir) : ();
46             }
47              
48             1;
49              
50             __END__