Permalink
Browse files

Correct skipping of pod tests.

  • Loading branch information...
1 parent 7d0ba62 commit 70a3b6fe7ec2ea7b17a5b324fac8e41e692a40d8 @pjcj committed May 6, 2005
Showing with 60 additions and 59 deletions.
  1. +4 −11 lib/Devel/Cover/Test.pm
  2. +26 −24 test_output/cover/pod.5.006001
  3. +26 −24 test_output/cover/pod_nocp.5.006001
  4. +2 −0 tests/pod
  5. +2 −0 tests/pod_nocp
View
@@ -75,7 +75,7 @@ sub get_params
$self->{cover_parameters} .= " -uncoverable $self->{uncoverable}"
if $self->{uncoverable};
$self->{skip} = $self->{skip_reason}
- if exists $self->{skip_test} && eval $self->{skip_test};
+ if exists $self->{skip_test} && eval "{$self->{skip_test}}";
$self
}
@@ -204,22 +204,15 @@ sub run_test
eval "use Test::Differences";
my $differences = $INC{"Test/Differences.pm"};
- my $skip = $self->{skip};
- if (!$skip && $self->{criteria} =~ /\bpod\b/)
- {
- eval "use Pod::Coverage";
- $skip = $INC{"Pod/Coverage.pm"} ? "" : "Pod::Coverage unavailable";
- }
-
- plan tests => ($differences || $skip)
+ plan tests => ($differences || $self->{skip})
? 1
: exists $self->{tests}
? $self->{tests}->(scalar @cover)
: scalar @cover;
- if ($skip)
+ if ($self->{skip})
{
- skip($skip, 1);
+ skip($self->{skip}, 1);
return;
}
@@ -97,32 +97,34 @@ line err pod code
8 # http://www.pjcj.net
9
10 # __COVER__ criteria pod-also_private-xx
-11
-12 use strict;
-13 use warnings;
-14
-15 use lib "tests";
+11 # __COVER__ skip_test eval "use Pod::Coverage:CountParents"; $@
+12 # __COVER__ skip_reason Pod::Coverage:CountParents unavailable
+13
+14 use strict;
+15 use warnings;
16
-17 use PodMod;
+17 use lib "tests";
18
-19 my @x;
+19 use PodMod;
20
-21 sub xx
-22 {
-23 $x[shift]++;
-24 Module1::zz(0);
-25 }
-26
-27 for (0 .. 10)
-28 {
-29 if (time)
-30 {
-31 xx(0);
-32 }
-33 else
-34 {
-35 $x[1]++;
-36 }
-37 }
+21 my @x;
+22
+23 sub xx
+24 {
+25 $x[shift]++;
+26 Module1::zz(0);
+27 }
+28
+29 for (0 .. 10)
+30 {
+31 if (time)
+32 {
+33 xx(0);
+34 }
+35 else
+36 {
+37 $x[1]++;
+38 }
+39 }
@@ -97,32 +97,34 @@ line err pod code
8 # http://www.pjcj.net
9
10 # __COVER__ criteria pod-nocp-also_private-xx
-11
-12 use strict;
-13 use warnings;
-14
-15 use lib "tests";
+11 # __COVER__ skip_test eval "use Pod::Coverage"; $@
+12 # __COVER__ skip_reason Pod::Coverage unavailable
+13
+14 use strict;
+15 use warnings;
16
-17 use PodMod;
+17 use lib "tests";
18
-19 my @x;
+19 use PodMod;
20
-21 sub xx
-22 {
-23 $x[shift]++;
-24 Module1::zz(0);
-25 }
-26
-27 for (0 .. 10)
-28 {
-29 if (time)
-30 {
-31 xx(0);
-32 }
-33 else
-34 {
-35 $x[1]++;
-36 }
-37 }
+21 my @x;
+22
+23 sub xx
+24 {
+25 $x[shift]++;
+26 Module1::zz(0);
+27 }
+28
+29 for (0 .. 10)
+30 {
+31 if (time)
+32 {
+33 xx(0);
+34 }
+35 else
+36 {
+37 $x[1]++;
+38 }
+39 }
View
@@ -8,6 +8,8 @@
# http://www.pjcj.net
# __COVER__ criteria pod-also_private-xx
+# __COVER__ skip_test eval "use Pod::Coverage:CountParents"; $@
+# __COVER__ skip_reason Pod::Coverage::CountParents unavailable
use strict;
use warnings;
View
@@ -8,6 +8,8 @@
# http://www.pjcj.net
# __COVER__ criteria pod-nocp-also_private-xx
+# __COVER__ skip_test eval "use Pod::Coverage"; $@
+# __COVER__ skip_reason Pod::Coverage unavailable
use strict;
use warnings;

0 comments on commit 70a3b6f

Please sign in to comment.