File Coverage

inc/Module/Build/with/XSTests.pm
Criterion Covered Total %
statement 23 25 92.0
branch 3 4 75.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 32 37 86.4


line stmt bran cond sub pod time code
1             package Module::Build::with::XSTests;
2              
3 1     1   33 use v5.14;
  1         4  
4 1     1   6 use warnings;
  1         2  
  1         120  
5              
6 1     1   7 use base qw( Module::Build );
  1         3  
  1         1018  
7              
8             # Stolen and edited from Module::Build::Base::_infer_xs_spec
9             sub _infer_xs_spec
10             {
11 9     9   2053772 my $self = shift;
12 9         31 my ( $file ) = @_;
13              
14 9         69 my $spec = $self->SUPER::_infer_xs_spec( $file );
15              
16 9 100       4526 if( $file =~ m{^t/} ) {
17             $spec->{$_} = File::Spec->catdir( "t", $spec->{$_} )
18 8         175 for qw( archdir bs_file lib_file );
19             }
20              
21 9         29 return $spec;
22             }
23              
24             # Various bits stolen from Module::Build::Base::
25             # process_xs_files()
26             sub ACTION_testlib
27             {
28 1     1 0 2102 my $self = shift;
29              
30 1         42 my $testxsfiles = $self->_find_file_by_type('xs', 't');
31              
32 1         1224 foreach my $from ( sort keys %$testxsfiles ) {
33 8         5316377 my $to = $testxsfiles->{$from};
34              
35 8 50       46 if( $to ne $from ) {
36 0         0 $self->add_to_cleanup( $to );
37 0         0 $self->copy_if_modified( from => $from, to => $to );
38             }
39              
40 8         143 $self->process_xs( $to );
41             }
42             }
43              
44             sub ACTION_test
45             {
46 1     1 0 106 my $self = shift;
47 1         33 $self->depends_on( "testlib" );
48              
49 1         1025119 $self->SUPER::ACTION_test( @_ );
50             }
51              
52             0x55AA;