Skip to content

Commit

Permalink
Don't open golden results if the test is skipped.
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcj committed Oct 13, 2011
1 parent 4454bf7 commit 5aa948d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/Devel/Cover/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ sub run_test

my $debug = $ENV{DEVEL_COVER_DEBUG} || 0;

if ($self->{skip})
{
plan tests => 1;
skip($self->{skip}, 1);
return;
}

my $gold = $self->cover_gold;
open I, $gold or die "Cannot open $gold: $!";
my @cover = <I>;
Expand All @@ -224,17 +231,11 @@ sub run_test
eval "use Test::Differences";
my $differences = $INC{"Test/Differences.pm"};

plan tests => ($differences || $self->{skip})
? 1
: exists $self->{tests}
? $self->{tests}->(scalar @cover)
: scalar @cover;

if ($self->{skip})
{
skip($self->{skip}, 1);
return;
}
plan tests => $differences
? 1
: exists $self->{tests}
? $self->{tests}->(scalar @cover)
: scalar @cover;

local $ENV{PERL5OPT};

Expand Down

0 comments on commit 5aa948d

Please sign in to comment.