Permalink
Browse files

import Devel::Cover 0.28

  • Loading branch information...
1 parent a0df00b commit cb76b0dd86bec278363faa5cf8f6a1c7079518d7 @pjcj committed Nov 3, 2004
View
14 CHANGES
@@ -152,7 +152,17 @@ Release 0.26 - 12th October 2003
- Decline to output HTML results for conditions containing > 16 terms.
- Add titles to HTML output.
-Release 0.27 -
+Release 0.27 - 9th November 2003
- Behave sensibly if import() is not called, for example when MakeMaker does a
PREREQ_PM check.
- - Use Storable for the database instead if Data::Dumper/eval (Michael Carman).
+ - Use Storable for the database instead of Data::Dumper/eval (Michael Carman).
+
+Release 0.28 - 1st December 2003
+ - Remove leading whitespace from HTML templates (Gabor Szabo).
+ - Remove obsolete indent option.
+ - Add MD5 checksums (Michael Carman).
+ - Add Html_minimal.pm (Michael Carman) (Obsoleting Gabor's patch before it was
+ released).
+ - Pass unknown cover options to the formatter and remove -option.
+ - Specify the output directory for HTML.
+ - Search up directory trees for modules.
View
@@ -26,6 +26,7 @@ lib/Devel/Cover/Report/Html.pm
lib/Devel/Cover/Report/Html_basic.pm
lib/Devel/Cover/Report/Text2.pm
lib/Devel/Cover/Report/Html_subtle.pm
+lib/Devel/Cover/Report/Html_minimal.pm
lib/Devel/Cover/Truth_Table.pm
cover
gcov2perl
View
@@ -1,11 +1,12 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: Devel-Cover
-version: 0.27
+version: 0.28
version_from:
installdirs: site
requires:
+ Digest::MD5: 0
Storable: 0
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.19
+generated_by: ExtUtils::MakeMaker version 6.21
View
@@ -19,8 +19,8 @@ use ExtUtils::Manifest "maniread";
$| = 1;
-my $Version = "0.27";
-my $Date = "9th November 2003";
+my $Version = "0.28";
+my $Date = "1st December 2003";
my $Author = 'pjcj@cpan.org';
my @perlbug = ("perlbug", "-a", $Author,
@@ -128,6 +128,26 @@ else
print "not found\n\n$e\n";
}
+print "checking for Digest::MD5.pm ........ ";
+
+$e = <<EOM;
+
+Digest::MD5.pm is required to check whether covered files have changed.
+You can download Digest::MD5 from CPAN.
+
+EOM
+
+eval "use Digest::MD5";
+if (my $m = $INC{"Digest/MD5.pm"})
+{
+ my $v = eval { no warnings; $Digest::MD5::VERSION };
+ print "$v $m\n";
+}
+else
+{
+ print "not found\n\n$e\n";
+}
+
print "checking for Template.pm version 2.00 ........ ";
$e = <<EOM;
@@ -192,7 +212,10 @@ WriteMakefile
ABSTRACT => "Code coverage metrics for Perl",
DIR => [],
EXE_FILES => [ "cover", "gcov2perl" ],
- PREREQ_PM => { Storable => 0 },
+ PREREQ_PM => {
+ Storable => 0,
+ "Digest::MD5" => 0,
+ },
dist => { COMPRESS => "gzip --best --force" },
clean => { FILES => join " ", "t/*", map "$_.version", @versions },
realclean => { FILES => "lib/Devel/Cover/Inc.pm cover_db t" },
@@ -263,11 +286,11 @@ ppm : ppd pure_all
_run : pure_all
\t \$(PERL) -Mblib -MDevel::Cover=-ignore,blib,-merge,0,`\$(PERL) -e 'qx|grep __COVER__ \$\$ARGV[0]| =~ /__COVER__\\s+criteria\\s+(.*)/; (\$\$c = \$\$1 || "all") =~ s/\\s+/,/g; print "-coverage,\$\$c"' tests/\$(TEST)` tests/\$(TEST) && \\
- \$(PERL) -Mblib cover -report text \\
- > \$(TEST).out
+ \$(PERL) -Mblib cover -report text > \$(TEST).out
run : _run
-\t gvim -d \$(TEST).out
+\t \$(PERL) -Mblib cover && \\
+ gvim -d \$(TEST).out
diff : _run
\t gvim -d -font 8x13 test_output/cover/\$(TEST).$test_version \$(TEST).out
View
2 README
@@ -35,6 +35,8 @@ DESCRIPTION
Perl 5.6.1 or greater. (Perl 5.7.0 is also unsupported.)
The ability to compile XS extensions.
+ Storable (in the core in Perl 5.8.0 and above).
+ Digest::MD5 (in the core in Perl 5.8.0 and above).
Pod::Coverage if you want pod coverage.
Template Toolkit 2 if you want HTML output.
View
4 TODO
@@ -1,6 +1,8 @@
- Indicate how to increase coverage?
- Collect data for path coverage.
- Tests.
+ - Functional tests.
+ - md5 tests.
- Documentation.
- Profiling and speedups.
- BEGIN and END blocks.
@@ -9,13 +11,11 @@
- Work with memoize.
- Fix up Devel::Cover::Op
- See if the XS code leaks, and fix it if it does.
-- Specify where html output goes.
- Different criteria for different runs.
- Improve textual output.
- Add platform and version info to DB.
- Refactor output routines to use common template data.
- Look at time coverage again - collecting for too many ops?
-- MD5 file and check it hasn't changed (Integrate patch from Michael Carman).
- Merge data from dynamically created subs.
- Separate output for pod coverage, like subroutine coverage.
- Extend cpancover so people can upload databases.
View
56 cover
@@ -12,44 +12,46 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.27";
+our $VERSION = "0.28";
-use Devel::Cover::DB 0.27;
+use Devel::Cover::DB 0.28;
+use Cwd "abs_path";
+use File::Path;
use Getopt::Long;
-
use Pod::Usage;
my $Options =
{
- coverage => [],
- delete => 0,
- file => [],
- option => [],
- report => "",
- summary => 1,
+ coverage => [],
+ delete => 0,
+ file => [],
+ report => "",
+ summary => 1,
};
sub get_options
{
@ARGV = qw( -report html ) unless @ARGV;
+ Getopt::Long::Configure("pass_through");
die "Bad option" unless
GetOptions($Options, # Store the options in the Options hash.
"write:s" => sub
{
- @$Options{qw(write summary)} = ($_[1], 0)
+ @$Options{qw( write summary )} = ($_[1], 0)
},
qw(
coverage=s
delete!
help|h!
file=s
info|i!
- option=s
+ outputdir=s
report=s
summary!
version|v!
));
+ Getopt::Long::Configure("nopass_through");
}
sub main
@@ -68,11 +70,19 @@ sub main
}
}
+ $format->get_options($Options) if $format->can("get_options");
+
print "$0 version $VERSION\n" and exit 0 if $Options->{version};
pod2usage(-exitval => 0, -verbose => 0) if $Options->{help};
pod2usage(-exitval => 0, -verbose => 2) if $Options->{info};
- my $dbname = shift @ARGV || "cover_db";
+ my $dbname = Cwd::abs_path(@ARGV ? shift @ARGV : "cover_db");
+ die "Can't open database $dbname\n" unless -d $dbname;
+
+ $Options->{outputdir} = $dbname unless exists $Options->{outputdir};
+ my $od = Cwd::abs_path($Options->{outputdir});
+ $Options->{outputdir} = $od if defined $od;
+ mkpath($Options->{outputdir}) unless -d $Options->{outputdir};
if ($Options->{delete})
{
@@ -131,10 +141,11 @@ cover - report coverage statistics
=head1 SYNOPSIS
- cover -help -info -version -summary
- -report report_format -option option
- -file filename -coverage criterion -write [db]
- -delete
+ cover -help -info -version
+ -summary -report report_format
+ -file filename -write [db] -delete
+ -coverage criterion
+ [report specific options]
coverage_database [coverage_database ...]
=head1 DESCRIPTION
@@ -153,19 +164,20 @@ The following reports are currently available:
The following command line options are supported:
+ -h -help - show help
+ -i -info - show documentation
+ -v -version - show version
+
-summary - give summary report (default on)
- -report report_format - report format required (default none)
- -option - options for report
+ -report report_format - report format required (default html)
-file filename - only report on the file (default all)
-write [db] - write the merged database (default off)
-delete - drop database(s) (default off)
-coverage criterion - report on criterion (default all available)
- -h -help - show help
- -i -info - show documentation
- -v -version - show version
+ other options specific to the report
=head1 DETAILS
@@ -203,7 +215,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.27 - 9th November 2003
+Version 0.28 - 1st December 2003
=head1 LICENCE
View
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.27";
+our $VERSION = "0.28";
-use Devel::Cover::DB 0.27;
+use Devel::Cover::DB 0.28;
use Cwd ();
use File::Find ();
@@ -120,9 +120,10 @@ sub get_cover
my $func = sub
{
- sys "$^X $inc $s/cover -report html"
+ my $od = "$Options->{outputdir}/$module";
+ sys "$^X $inc $s/cover -report html -outputdir $od"
if -d && /^cover_db\z/ &&
- (!-e "$_/cover_db.html" || $Options->{redo_html});
+ (!-e "$od/coverage.html" || $Options->{redo_html});
};
File::Find::find($func, $d);
@@ -234,7 +235,7 @@ sub write_html
my $results = read_results;
my $f = "$Options->{outputdir}/cpancover.html";
- print "\n\nWriting results to $f\n";
+ print "\n\nWriting cpancover output to $f ...\n";
my $vars =
{
@@ -246,7 +247,7 @@ sub write_html
my $func = sub
{
- if (/^cover_db\.html\z/s)
+ if (/^cover\.5\z/s)
{
my $base = $Options->{directory};
my $db = Devel::Cover::DB->new(db => "$base/$File::Find::dir");
@@ -260,7 +261,7 @@ sub write_html
my $module = $File::Find::dir;
$module =~ s|/cover_db$||;
push @{$vars->{modules}}, $module;
- $vals{$module}{link} = $File::Find::name;
+ $vals{$module}{link} = "$module/coverage.html";
for my $criterion (@$criteria)
{
@@ -287,6 +288,8 @@ sub write_html
write_stylesheet;
$Template->process("summary", $vars, $f) or die $Template->error();
+
+ print "done.\n";
}
sub main
@@ -311,7 +314,7 @@ package Devel::Cover::Cpancover::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.27";
+our $VERSION = "0.28";
use base "Template::Provider";
@@ -347,7 +350,7 @@ $Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.27
+This file was generated by Devel::Cover Version 0.28
Devel::Cover is copyright 2001-2003, Paul Johnson (pjcj@cpan.org)
@@ -456,7 +459,7 @@ The following exit values are returned:
=head1 VERSION
-Version 0.27 - 9th November 2003
+Version 0.28 - 1st December 2003
=head1 LICENCE
View
@@ -12,11 +12,11 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.27";
+our $VERSION = "0.28";
use blib;
-use Devel::Cover::Test 0.27;
+use Devel::Cover::Test 0.28;
my @tests = @ARGV;
View
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.27";
+our $VERSION = "0.28";
-use Devel::Cover::DB 0.27;
+use Devel::Cover::DB 0.28;
use Getopt::Long;
use Pod::Usage;
@@ -128,7 +128,7 @@ Huh?
=head1 VERSION
-Version 0.27 - 9th November 2003
+Version 0.28 - 1st December 2003
=head1 LICENCE
Oops, something went wrong.

0 comments on commit cb76b0d

Please sign in to comment.