Permalink
Browse files

import Devel::Cover 0.40

  • Loading branch information...
1 parent c483236 commit 37233bc1a26cf6f0fbda23fa247692dec86547ff @pjcj committed Nov 3, 2004
Showing with 507 additions and 606 deletions.
  1. +7 −0 CHANGES
  2. +32 −52 Cover.xs
  3. +1 −1 MANIFEST
  4. +1 −1 META.yml
  5. +2 −2 Makefile.PL
  6. +3 −3 cover
  7. +5 −5 cpancover
  8. +2 −2 create_gold
  9. +3 −3 gcov2perl
  10. +122 −71 lib/Devel/Cover.pm
  11. +2 −2 lib/Devel/Cover/Branch.pm
  12. +2 −2 lib/Devel/Cover/Condition.pm
  13. +2 −2 lib/Devel/Cover/Condition_and_3.pm
  14. +2 −2 lib/Devel/Cover/Condition_or_2.pm
  15. +2 −2 lib/Devel/Cover/Condition_or_3.pm
  16. +2 −2 lib/Devel/Cover/Condition_xor_4.pm
  17. +13 −13 lib/Devel/Cover/Criterion.pm
  18. +9 −77 lib/Devel/Cover/DB.pm
  19. +3 −3 lib/Devel/Cover/DB/File.pm
  20. +17 −3 lib/Devel/Cover/DB/Structure.pm
  21. +2 −2 lib/Devel/Cover/Op.pm
  22. +2 −2 lib/Devel/Cover/Pod.pm
  23. +2 −2 lib/Devel/Cover/Report/Html.pm
  24. +5 −5 lib/Devel/Cover/Report/Html_basic.pm
  25. +5 −5 lib/Devel/Cover/Report/Html_minimal.pm
  26. +6 −6 lib/Devel/Cover/Report/Html_subtle.pm
  27. +4 −4 lib/Devel/Cover/Report/Text.pm
  28. +3 −3 lib/Devel/Cover/Report/Text2.pm
  29. +2 −2 lib/Devel/Cover/Statement.pm
  30. +2 −2 lib/Devel/Cover/Subroutine.pm
  31. +2 −2 lib/Devel/Cover/Test.pm
  32. +2 −2 lib/Devel/Cover/Time.pm
  33. +2 −2 lib/Devel/Cover/Truth_Table.pm
  34. +1 −1 lib/Devel/Cover/Tutorial.pod
  35. +64 −78 test_output/cover/dynamic_subs.5.006001
  36. +64 −78 test_output/cover/dynamic_subs.5.008001
  37. +0 −130 test_output/cover/dynamic_subs.5.009
  38. +44 −6 test_output/cover/eval1.5.006001
  39. +6 −6 test_output/cover/module_import.5.006001
  40. +6 −6 test_output/cover/module_import.5.008
  41. +6 −6 test_output/cover/module_import.5.008001
  42. +2 −6 tests/dynamic_subs
  43. +25 −0 tests/eval1
  44. +2 −2 tests/md5.t
  45. +16 −0 typemap
View
@@ -255,3 +255,10 @@ Release 0.39 - 22nd March 2004
- Check for Test::Differences in Makefile.PL.
- Test with perl5.9.2.
- Skip fork test on MSWin32.
+
+Release 0.40 - 22nd March 2004
+ - Reove DB structure for unwanted files.
+ - Identify ops based on address and OP contents, except for op_ppaddr
+ which we modify.
+ - Overhaul of coverage collection.
+ - Additions to tests.
View
@@ -55,18 +55,18 @@ static HV *Cover_hv,
static OP *Profiling_op = 0;
-#define ch_sz (sizeof(void *) + sizeof(PADOFFSET))
-
struct unique /* Well, we'll be fairly unlucky if it's not */
{
- void *addr;
- PADOFFSET pad;
+ OP *addr;
+ OP op;
};
+#define ch_sz (sizeof(struct unique) + 1)
+
union sequence /* Hack, hack, hackety hack. */
{
struct unique op;
- char ch[ch_sz + 1];
+ char ch[ch_sz + 1];
};
#ifdef HAS_GETTIMEOFDAY
@@ -93,8 +93,6 @@ static double get_elapsed()
gettimeofday(&time, NULL);
e = time.tv_sec * 1e6 + time.tv_usec;
- /* fprintf(stderr, "[[[%f]]]\n", e); */
-
return e;
}
@@ -139,8 +137,6 @@ static int cpu()
utime = time.tms_utime;
stime = time.tms_stime;
- /* fprintf(stderr, "<<<%d>>>\n", utime + stime); */
-
return e / HZ;
}
@@ -151,13 +147,19 @@ static int cpu()
static char *get_key(OP *o)
{
static union sequence uniq;
+ int i;
- uniq.op.addr = o;
- uniq.op.pad = o->op_targ;
- uniq.ch[ch_sz] = 0;
+ uniq.op.addr = o;
+ uniq.op.op = *o;
+ uniq.op.op.op_ppaddr = 0; /* we mess with this field */
+ uniq.ch[ch_sz] = 0;
- NDEB(D(L, "0x%x 0x%x => <%s>\n", o, o->op_targ, uniq.ch));
+ for (i = 0; i < ch_sz; i++)
+ /* if (uniq.ch[i] < 32 || uniq.ch[i] > 126 ) */
+ if (!uniq.ch[i])
+ uniq.ch[i] = 'x';
+ NDEB(D(L, "0x%x <%s>\n", o, uniq.ch));
return uniq.ch;
}
@@ -336,9 +338,12 @@ static OP *get_condition(pTHX)
}
else
{
- Perl_croak(aTHX_
- "All is lost, I know not where to go from %p, %p: %p\n",
- PL_op, PL_op->op_targ, sv);
+ NDEB(D(L, "[%s]\n", ch));
+ /* PDEB(svdump(*sv)); */
+ PDEB(D(L, "All is lost, I know not where to go from %p, %p: %p\n",
+ PL_op, PL_op->op_targ, sv));
+ PDEB(svdump(Pending_conditionals));
+ exit(1);
}
return PL_op;
@@ -680,40 +685,7 @@ static int runops_orig(pTHX)
return 0;
}
-#if 0
-static void cv_destroy_cb(pTHX_ CV *cv)
-{
- SV *sv;
- IV iv;
- dSP;
-
- PDEB(D(L, "cv_destroy_cb %p - %p\n", cv, Covering));
-
- if (!Covering)
- return;
-
- ENTER;
- SAVETMPS;
-
- PUSHMARK(SP);
-
- sv = sv_newmortal();
- iv = PTR2IV(cv);
- sv_setiv(newSVrv(sv, "B::CV"), iv);
-
- XPUSHs(sv);
- /* XPUSHs(sv_2mortal(newSViv(cv))); */
-
- PUTBACK;
-
- call_pv("Devel::Cover::get_cover_x", G_DISCARD);
-
- FREETMPS;
- LEAVE;
-
- NDEB(svdump(cv));
-}
-#endif
+typedef OP *B__OP;
MODULE = Devel::Cover PACKAGE = Devel::Cover
@@ -821,10 +793,18 @@ coverage()
else
ST(0) = &PL_sv_undef;
+char *
+get_key(o)
+ B::OP o
+ CODE:
+ RETVAL = get_key(o);
+ OUTPUT:
+ RETVAL
+
+
BOOT:
- /* PL_runops = runops_orig; */
+ PL_runops = runops_cover;
/* PL_savebegin = TRUE; */
/* PL_savecheck = TRUE; */
/* PL_saveinit = TRUE; */
/* PL_saveend = TRUE; */
- /* PL_cv_destroy_cb = cv_destroy_cb; */
View
@@ -6,6 +6,7 @@ BUGS
Makefile.PL
lib/Devel/Cover.pm
Cover.xs
+typemap
lib/Devel/Cover/DB.pm
lib/Devel/Cover/Op.pm
lib/Devel/Cover/Criterion.pm
@@ -83,7 +84,6 @@ test_output/cover/default_param.5.008001
test_output/cover/destroy.5.006001
test_output/cover/dynamic_subs.5.006001
test_output/cover/dynamic_subs.5.008001
-test_output/cover/dynamic_subs.5.009
test_output/cover/eval1.5.006001
test_output/cover/fork.5.006001
test_output/cover/if.5.006001
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.39
+version: 0.40
version_from:
installdirs: site
requires:
View
@@ -19,8 +19,8 @@ use File::Copy;
$| = 1;
-my $Version = "0.39";
-my $Date = "22nd March 2004";
+my $Version = "0.40";
+my $Date = "24th March 2004";
my $Author = 'pjcj@cpan.org';
my @perlbug = ("perlbug", "-a", $Author,
View
6 cover
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.39";
+our $VERSION = "0.40";
-use Devel::Cover::DB 0.39;
+use Devel::Cover::DB 0.40;
use Cwd "abs_path";
use Data::Dumper;
@@ -258,7 +258,7 @@ See the BUGS file.
=head1 VERSION
-Version 0.39 - 22nd March 2004
+Version 0.40 - 24th March 2004
=head1 LICENCE
View
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.39";
+our $VERSION = "0.40";
-use Devel::Cover::DB 0.39;
+use Devel::Cover::DB 0.40;
use Cwd ();
use File::Find ();
@@ -313,7 +313,7 @@ package Devel::Cover::Cpancover::Template::Provider;
use strict;
use warnings;
-our $VERSION = "0.39";
+our $VERSION = "0.40";
use base "Template::Provider";
@@ -349,7 +349,7 @@ $Templates{html} = <<'EOT';
<!--
-This file was generated by Devel::Cover Version 0.39
+This file was generated by Devel::Cover Version 0.40
Devel::Cover is copyright 2001-2004, Paul Johnson (pjcj@cpan.org)
@@ -458,7 +458,7 @@ The following exit values are returned:
=head1 VERSION
-Version 0.39 - 22nd March 2004
+Version 0.40 - 24th March 2004
=head1 LICENCE
View
@@ -12,11 +12,11 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.39";
+our $VERSION = "0.40";
use blib;
-use Devel::Cover::Test 0.39;
+use Devel::Cover::Test 0.40;
my @tests = @ARGV;
View
@@ -12,9 +12,9 @@ require 5.6.1;
use strict;
use warnings;
-our $VERSION = "0.39";
+our $VERSION = "0.40";
-use Devel::Cover::DB 0.39;
+use Devel::Cover::DB 0.40;
use Getopt::Long;
use Pod::Usage;
@@ -123,7 +123,7 @@ Huh?
=head1 VERSION
-Version 0.39 - 22nd March 2004
+Version 0.40 - 24th March 2004
=head1 LICENCE
Oops, something went wrong.

0 comments on commit 37233bc

Please sign in to comment.