1#!/usr/bin/perl 2use File::Basename; 3use File::Spec; 4use strict; 5my $THISDIR; 6BEGIN { 7 $THISDIR = dirname $0; 8 unshift @INC, $THISDIR; 9 require "testpchk.pl"; 10 import TestPodChecker qw(testpodcheck); 11} 12 13# test that our POD is correct! 14my $path = File::Spec->catfile($THISDIR,(File::Spec->updir()) x 2, 'lib', 'Pod', '*.pm'); 15print "THISDIR=$THISDIR PATH=$path\n"; 16my @pods = glob($path); 17print "PODS=@pods\n"; 18 19print "1..",scalar(@pods),"\n"; 20 21my $errs = 0; 22my $testnum = 1; 23foreach my $pod (@pods) { 24 my $out = File::Spec->catfile($THISDIR, basename($pod)); 25 $out =~ s{\.pm}{.OUT}; 26 my %options = ( -Out => $out ); 27 my $failmsg = testpodcheck(-In => $pod, -Out => $out, -Cmp => "$THISDIR/empty.xr"); 28 if($failmsg) { 29 if(open(IN, "<$out")) { 30 while(<IN>) { 31 warn "podchecker: $_"; 32 } 33 close(IN); 34 } else { 35 warn "Error: Cannot read output file $out: $!\n"; 36 } 37 print "not ok $testnum\n"; 38 $errs++; 39 } else { 40 print "ok $testnum\n"; 41 } 42 $testnum++; 43} 44exit( ($errs == 0) ? 0 : -1 ) unless $ENV{HARNESS_ACTIVE}; 45 46