POD coverage tests, as a TODO for now
authorTony Cook <tony@develop=help.com>
Mon, 13 Mar 2006 01:58:44 +0000 (01:58 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 13 Mar 2006 01:58:44 +0000 (01:58 +0000)
MANIFEST
t/Pod/Coverage/Imager.pm [new file with mode: 0644]
t/t101jpeg.t
t/t93podcover.t [new file with mode: 0644]

index 35ca0ec..07dec82 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -208,6 +208,7 @@ t/t82inline.t           Test Inline::C integration
 t/t90cc.t
 t/t91pod.t             Test POD with Test::Pod
 t/t92samples.t
+t/t93prodcover.t       POD Coverage tests
 t/testtools.pl
 tags.c
 testimg/209_yonge.jpg  Regression test: #17981
diff --git a/t/Pod/Coverage/Imager.pm b/t/Pod/Coverage/Imager.pm
new file mode 100644 (file)
index 0000000..fe79649
--- /dev/null
@@ -0,0 +1,28 @@
+package Pod::Coverage::Imager;
+use base 'Pod::Coverage';
+
+sub _get_pods {
+  my $self = shift;
+
+  my $package = $self->{package};
+
+  #print "getting pod location for '$package'\n" if TRACE_ALL;
+  $self->{pod_from} ||= pod_where( { -inc => 1 }, $package );
+
+  my $pod_from = $self->{pod_from};
+  $pod_from = [ $pod_from ] unless ref $pod_from;
+  unless ($pod_from) {
+    $self->{why_unrated} = "couldn't find pod";
+    return;
+  }
+  
+  #print "parsing '$pod_from'\n" if TRACE_ALL;
+  my $pod = Pod::Coverage::Extractor->new;
+  for my $pod_file (@$pod_from) {
+    $pod->parse_from_file( $pod_file, '/dev/null' );
+  }
+  
+  return $pod->{identifiers} || [];
+}
+
+1;
index f7eddf8..2ee310c 100644 (file)
@@ -52,12 +52,12 @@ if (!i_has_format("jpeg")) {
 
   ok($diff < 10000, "difference between original and jpeg within bounds");
 
-       Imager::log_entry("Starting 4\n", 1);
+       Imager::i_log_entry("Starting 4\n", 1);
   my $imoo = Imager->new;
   ok($imoo->read(file=>'testout/t101.jpg'), "read jpeg OO");
 
   ok($imoo->write(file=>'testout/t101_oo.jpg'), "write jpeg OO");
-       Imager::log_entry("Starting 5\n", 1);
+       Imager::i_log_entry("Starting 5\n", 1);
   my $oocmp = Imager->new;
   ok($oocmp->read(file=>'testout/t101_oo.jpg'), "read jpeg OO for comparison");
 
diff --git a/t/t93podcover.t b/t/t93podcover.t
new file mode 100644 (file)
index 0000000..1ad34bd
--- /dev/null
@@ -0,0 +1,27 @@
+#!perl -w
+use strict;
+use lib 't';
+use Test::More;
+use ExtUtils::Manifest qw(maniread);
+eval "use Test::Pod::Coverage 1.08;";
+# 1.08 required for coverage_class support
+plan skip_all => "Test::Pod::Coverage 1.08 required for POD coverage" if $@;
+plan tests => 1;
+
+# scan for a list of files to get Imager method documentation from
+my $manifest = maniread();
+my @pods = ( 'Imager.pm', grep /\.pod$/, keys %$manifest );
+
+my @private = ( '^io?_', '^DSO_', '^Inline$', '^yatf$', '^m_init_log$' );
+my @trustme = ( '^errstr$', '^open$' );
+
+TODO: {
+  local $TODO = "Still working on method coverage";
+  pod_coverage_ok('Imager', { also_private => \@private,
+                             pod_from => \@pods,
+                             trustme => \@trustme,
+                             coverage_class => 'Pod::Coverage::Imager' },
+                 "Imager");
+                 
+}
+