Permalink
Browse files

import Devel::Cover 0.43

  • Loading branch information...
1 parent 2585fae commit f19d2285d8d73508122d3a9f4253124970748544 @pjcj committed Nov 3, 2004
Showing with 449 additions and 330 deletions.
  1. +2 −0 BUGS
  2. +8 −0 CHANGES
  3. +57 −15 Cover.xs
  4. +1 −1 META.yml
  5. +38 −23 Makefile.PL
  6. +4 −0 TODO
  7. +3 −3 cover
  8. +6 −5 cpancover
  9. +2 −2 create_gold
  10. +3 −3 gcov2perl
  11. +56 −27 lib/Devel/Cover.pm
  12. +2 −2 lib/Devel/Cover/Branch.pm
  13. +2 −2 lib/Devel/Cover/Condition.pm
  14. +2 −2 lib/Devel/Cover/Condition_and_3.pm
  15. +2 −2 lib/Devel/Cover/Condition_or_2.pm
  16. +2 −2 lib/Devel/Cover/Condition_or_3.pm
  17. +2 −2 lib/Devel/Cover/Condition_xor_4.pm
  18. +13 −13 lib/Devel/Cover/Criterion.pm
  19. +9 −5 lib/Devel/Cover/DB.pm
  20. +3 −3 lib/Devel/Cover/DB/File.pm
  21. +4 −3 lib/Devel/Cover/DB/Structure.pm
  22. +2 −2 lib/Devel/Cover/Op.pm
  23. +2 −2 lib/Devel/Cover/Pod.pm
  24. +2 −2 lib/Devel/Cover/Report/Html.pm
  25. +5 −5 lib/Devel/Cover/Report/Html_basic.pm
  26. +5 −5 lib/Devel/Cover/Report/Html_minimal.pm
  27. +6 −6 lib/Devel/Cover/Report/Html_subtle.pm
  28. +3 −3 lib/Devel/Cover/Report/Text.pm
  29. +3 −3 lib/Devel/Cover/Report/Text2.pm
  30. +2 −2 lib/Devel/Cover/Statement.pm
  31. +2 −2 lib/Devel/Cover/Subroutine.pm
  32. +2 −2 lib/Devel/Cover/Test.pm
  33. +2 −2 lib/Devel/Cover/Time.pm
  34. +2 −2 lib/Devel/Cover/Truth_Table.pm
  35. +1 −1 lib/Devel/Cover/Tutorial.pod
  36. +28 −26 test_output/cover/module1.5.006001
  37. +31 −29 test_output/cover/module1.5.008
  38. +31 −29 test_output/cover/module1.5.008001
  39. +28 −26 test_output/cover/module2.5.006001
  40. +31 −29 test_output/cover/module2.5.008
  41. +31 −29 test_output/cover/module2.5.008001
  42. +5 −8 tests/md5.t
  43. +2 −0 tests/module1
  44. +2 −0 tests/module2
View
2 BUGS
@@ -16,3 +16,5 @@
- Pod coverage does not work well with source filters including Switch.
Line numbers are reported incorrectly.
+
+- If an END block installs another END block it won't be covered.
View
@@ -281,3 +281,11 @@ Release 0.42 - 30th April 2004
- Add SYNOPSIS section to README.
- Resolve links for Devel::Cover::Inc (Dave Rolsky).
- Get things running on Windows again.
+
+Release 0.43 - 2nd May 2004
+ - Ignore coverage on Devel::Cover's files by default.
+ -
+ - Cover INIT and END blocks more reliably.
+ - Fix 5.6 on Windows. Well, sort of.
+ - Add a message in Makefile.PL recommending against using Devel::Cover
+ on 5.6, especially under Windows.
View
@@ -157,19 +157,45 @@ static char *get_key(OP *o)
uniq.op.op.op_ppaddr = 0; /* we mess with this field */
uniq.ch[CH_SZ] = 0;
- /* TODO - this shouldn't be necessary. It is a hack because things
- * are breaking with null chars in the key. Replace them with x
+ /* TODO - this shouldn't be necessary, should it? It is a hack
+ * because things are breaking with null chars in the key. Replace
+ * them with x.
*/
for (i = 0; i < CH_SZ; i++)
- /* if (uniq.ch[i] < 32 || uniq.ch[i] > 126 ) */
+ /* if (uniq.ch[i] < 32 || uniq.ch[i] > 126 ) */ /* for printing */
if (!uniq.ch[i])
uniq.ch[i] = '-';
NDEB(D(L, "0x%x <%s>\n", o, uniq.ch));
return uniq.ch;
}
+static void set_firsts_if_neeed()
+{
+ SV *init = (SV *)get_cv("Devel::Cover::first_init", 0);
+ SV *end = (SV *)get_cv("Devel::Cover::first_end", 0);
+ NDEB(svdump(end));
+ if (av_len(PL_initav) >= 0)
+ {
+ SV **cv = av_fetch(PL_initav, 0, 0);
+ if (*cv != init)
+ {
+ av_unshift(PL_initav, 1);
+ av_store(PL_initav, 0, init);
+ }
+ }
+ if (av_len(PL_endav) >= 0)
+ {
+ SV **cv = av_fetch(PL_endav, 0, 0);
+ if (*cv != end)
+ {
+ av_unshift(PL_endav, 1);
+ av_store(PL_endav, 0, end);
+ }
+ }
+}
+
static void add_branch(OP *op, int br)
{
AV *branches;
@@ -586,6 +612,7 @@ static int runops_cover(pTHX)
}
}
sv_setpv(module, "");
+ set_firsts_if_neeed();
}
#endif
}
@@ -814,6 +841,14 @@ coverage_all()
double
get_elapsed()
+ CODE:
+#ifdef HAS_GETTIMEOFDAY
+ RETVAL = All;
+#else
+ RETVAL = 0;
+#endif
+ OUTPUT:
+ RETVAL
SV *
coverage(final)
@@ -835,18 +870,32 @@ get_key(o)
RETVAL
void
-copy_ends()
+set_first_init_and_end()
+ PPCODE:
+ set_firsts_if_neeed();
+
+void
+collect_inits()
PPCODE:
int i;
- OP *op;
- Ends = newAV();
+ NDEB(svdump(end));
+ if (!Ends) Ends = newAV();
if (PL_initav)
for (i = 0; i <= av_len(PL_initav); i++)
{
SV **cv = av_fetch(PL_initav, i, 0);
SvREFCNT_inc(*cv);
av_push(Ends, *cv);
}
+
+void
+set_last_end()
+ PPCODE:
+ int i;
+ SV *end = (SV *)get_cv("last_end", 0);
+ av_push(PL_endav, end);
+ NDEB(svdump(end));
+ if (!Ends) Ends = newAV();
if (PL_endav)
for (i = 0; i <= av_len(PL_endav); i++)
{
@@ -862,16 +911,9 @@ get_ends()
OUTPUT:
RETVAL
-void
-set_end()
- PPCODE:
- SV *end = (SV *)get_cv("end", 0);
- NDEB(svdump(end));
- av_push(PL_endav, end);
-
BOOT:
- PL_runops = runops_cover;
+ PL_runops = runops_cover;
#if (PERL_VERSION > 6)
- PL_savebegin = TRUE;
+ PL_savebegin = TRUE;
#endif
View
@@ -1,7 +1,7 @@
# 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.42
+version: 0.43
version_from:
installdirs: site
requires:
View
@@ -19,8 +19,8 @@ use File::Copy;
$| = 1;
-my $Version = "0.42";
-my $Date = "30th April 2004";
+my $Version = "0.43";
+my $Date = "2nd May 2004";
my $Author = 'pjcj@cpan.org';
my @perlbug = ("perlbug", "-a", $Author,
@@ -153,27 +153,28 @@ else
print "not found\n\n$e\n";
}
-# print "checking for Template.pm version 2.00 ........ ";
-#
-# $e = <<EOM;
-#
-# Template.pm 2.00 is required to run the HTML backend to cover and for
-# cpancover. You will not be able to generate HTML output until you
-# install the Template Toolkit, available from CPAN. In the meantime you
-# may continue to use the rest of Devel::Cover.
-#
-# EOM
-#
-# eval "use Template";
-# if (my $m = $INC{"Template.pm"})
-# {
- # my $v = eval { no warnings; $Template::VERSION };
- # print $v < 2.00 ? "$v\n\n$e\n" : "$v $m\n";
-# }
-# else
-# {
- # print "not found\n\n$e\n";
-# }
+print "checking for Template.pm version 2.00 ........ ";
+
+$e = <<EOM;
+
+Template.pm 2.00 is required to run the old HTML backends to cover and
+for cpancover. Unless you haev specific requirements this should not be
+a problem, but you will not be able to use these reports until you
+install the Template Toolkit, available from CPAN. In the meantime you
+may continue to use the rest of Devel::Cover.
+
+EOM
+
+eval "use Template";
+if (my $m = $INC{"Template.pm"})
+{
+ my $v = eval { no warnings; $Template::VERSION };
+ print $v < 2.00 ? "$v\n\n$e\n" : "$v $m\n";
+}
+else
+{
+ print "not found\n\n$e\n";
+}
print "checking for Pod::Coverage.pm version 0.06 ........ ";
@@ -229,6 +230,20 @@ You may well find failing tests.
EOM
+print <<EOM if $] < 5.008;
+
+Devel::Cover $Version is not fully functional on perl $]. It should
+mostly work, but there are some constructs for which coverage will not
+be collected. Perl versions 5.8.1 and above should work better.
+
+EOM
+
+print <<EOM if $] < 5.008 && $^O eq "MSWin32";
+And things are even worse under Windows. You may well find random bugs
+of various severities.
+
+EOM
+
print "\n" x 3;
$ExtUtils::MakeMaker::Verbose = 0;
View
4 TODO
@@ -25,3 +25,7 @@
- Move HTML version and platform info to main page and allow for multiples.
- Fix up shebang line on tests.
- Be able to run Devel::Cover on itself.
+- meta.yaml file to control pause indexing.
+- Overhaul test system. Include patt?
+- Tests for INIT and END blocks included in required files when the
+ files are used in some runs.
View
6 cover
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.42";
+our $VERSION = "0.43";
-use Devel::Cover::DB 0.42;
+use Devel::Cover::DB 0.43;
use Cwd "abs_path";
use Data::Dumper;
@@ -258,7 +258,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.42 - 30th April 2004
+Version 0.43 - 2nd May 2004
=head1 LICENCE
View
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.42";
+our $VERSION = "0.43";
-use Devel::Cover::DB 0.42;
+use Devel::Cover::DB 0.43;
use Cwd ();
use File::Find ();
@@ -309,7 +309,7 @@ package Devel::Cover::Cpancover::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.42";
+our $VERSION = "0.43";
use base "Template::Provider";
@@ -345,7 +345,7 @@ $Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.42
+This file was generated by Devel::Cover Version 0.43
Devel::Cover is copyright 2001-2004, Paul Johnson (pjcj@cpan.org)
@@ -450,11 +450,12 @@ The following exit values are returned:
=head1 BUGS
Incomplete.
+ Undocumented.
Needs to be redone properly.
=head1 VERSION
-Version 0.42 - 30th April 2004
+Version 0.43 - 2nd May 2004
=head1 LICENCE
View
@@ -12,11 +12,11 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.42";
+our $VERSION = "0.43";
use blib;
-use Devel::Cover::Test 0.42;
+use Devel::Cover::Test 0.43;
my @tests = @ARGV;
View
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.42";
+our $VERSION = "0.43";
-use Devel::Cover::DB 0.42;
+use Devel::Cover::DB 0.43;
use Getopt::Long;
use Pod::Usage;
@@ -123,7 +123,7 @@ Huh?
=head1 VERSION
-Version 0.42 - 30th April 2004
+Version 0.43 - 2nd May 2004
=head1 LICENCE
Oops, something went wrong.

0 comments on commit f19d228

Please sign in to comment.