Skip to content

Commit fbe955b

Browse files
mephinetLeont
authored andcommitted
Allow Devel::Cover usage with TAP::Harness
This sets -MDevel::Cover via harness_switches, thereby reaching both Test::Harness and TAP::Harness
1 parent d8e32a2 commit fbe955b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Revision history for Perl extension Module::Build.
55
- Reintroduce some level of perl 5.6 support [Leon Timmermans]
66
Note that this comes with no guarantees or commitment
77

8+
- Allow Devel::Cover usage with TAP::Harness [Philipp Gortan]
9+
810
0.4214 - Fri Jun 12 00:25:00 CEST 2015
911

1012
- Released 0.42_13 as 0.4214

lib/Module/Build/Base.pm

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ __PACKAGE__->add_property($_) for qw(
961961
base_dir
962962
bindoc_dirs
963963
c_source
964+
cover
964965
create_license
965966
create_makefile_pl
966967
create_readme
@@ -2751,7 +2752,11 @@ sub run_visual_script {
27512752
}
27522753

27532754
sub harness_switches {
2754-
shift->{properties}{debugger} ? qw(-w -d) : ();
2755+
my $self = shift;
2756+
my @res;
2757+
push @res, qw(-w -d) if $self->{properties}{debugger};
2758+
push @res, '-MDevel::Cover' if $self->{properties}{cover};
2759+
return @res;
27552760
}
27562761

27572762
sub test_files {
@@ -2802,10 +2807,7 @@ sub ACTION_testcover {
28022807
&& $self->up_to_date($self->test_files, $cover_files);
28032808
}
28042809

2805-
local $Test::Harness::switches =
2806-
local $Test::Harness::Switches =
2807-
local $ENV{HARNESS_PERL_SWITCHES} = "-MDevel::Cover";
2808-
2810+
local $self->{properties}{cover} = 1;
28092811
$self->depends_on('test');
28102812
$self->do_system('cover');
28112813
}

0 commit comments

Comments
 (0)