From 5b9f994b500389025d26bf32a9f8fa9d0dcd3681 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sat, 19 Nov 2005 05:38:22 +0000 Subject: [PATCH] added pod coverage test --- sbin/testEnvironment.pl | 5 ++-- t/POD.t | 66 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 t/POD.t diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index bee58c7c6..c0af30d2d 100644 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -45,7 +45,8 @@ if ($] >= 5.006) { checkModule("LWP",5.80); checkModule("HTTP::Request",1.40); checkModule("HTTP::Headers",1.61); -checkModule("Test::More",0.61); +checkModule("Test::More",0.61,1); +checkModule("Pod::Coverage",0.17,1); checkModule("Digest::MD5",2.20); checkModule("DBI",1.40); checkModule("DBD::mysql",2.1021); @@ -72,7 +73,7 @@ checkModule("Parse::PlainConfig",1.1); checkModule("XML::RSSLite",0.11); checkModule("POE",0.3202); checkModule("POE::Component::IKC::Server",0.18); -checkModule("Apache2::Request"); +checkModule("Apache2::Request",2.06); ################################### # Checking WebGUI diff --git a/t/POD.t b/t/POD.t new file mode 100644 index 000000000..a69b25feb --- /dev/null +++ b/t/POD.t @@ -0,0 +1,66 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2005 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +# ---- BEGIN DO NOT EDIT ---- +use strict; +use lib '../lib'; +use Getopt::Long; +use Pod::Coverage; +use File::Find; +use WebGUI::Session; +# ---- END DO NOT EDIT ---- + + +use Test::More; + +initialize(); # this line is required + +my $moduleCount = 0; +find(\&countModules, "../lib/WebGUI"); +diag("Planning on running $moduleCount tests\n"); +plan tests => $moduleCount; +find(\&checkPod, "../lib/WebGUI"); + +cleanup(); # this line is required + +sub countModules { + my $filename = $_; + return unless $filename =~ m/\.pm$/; + $moduleCount++; +} + +sub checkPod { + my $filename = $File::Find::dir."/".$_; + return unless $filename =~ m/\.pm$/; + my $package = $filename; + $package =~ s/^\.\.\/lib\/(.*)\.pm$/$1/; + $package =~ s/\//::/g; + my $pc = Pod::Coverage->new(package=>$package); + print $package.":".$pc->coverage.$pc->why_unrated."\n"; + #ok($pc->coverage, $package); +} + + +# ---- DO NOT EDIT BELOW THIS LINE ----- + +sub initialize { + $|=1; # disable output buffering + my $configFile; + GetOptions( + 'configFile=s'=>\$configFile + ); + exit 1 unless ($configFile); + WebGUI::Session::open("..",$configFile); +} + +sub cleanup { + WebGUI::Session::close(); +} +