Permalink
Browse files

import Devel::Cover 0.35

  • Loading branch information...
1 parent 19ecf3f commit 9f93b0b43fc6e5881af21bf25ef248c5205387ac @pjcj committed Nov 3, 2004
Showing with 1,111 additions and 2,963 deletions.
  1. +15 −0 CHANGES
  2. +28 −24 Cover.xs
  3. +15 −37 MANIFEST
  4. +1 −1 META.yml
  5. +39 −18 Makefile.PL
  6. +4 −0 TODO
  7. +4 −1 all_versions
  8. +23 −16 cover
  9. +34 −34 cpancover
  10. +6 −3 create_gold
  11. +3 −3 gcov2perl
  12. +83 −42 lib/Devel/Cover.pm
  13. +2 −2 lib/Devel/Cover/Branch.pm
  14. +2 −2 lib/Devel/Cover/Condition.pm
  15. +2 −2 lib/Devel/Cover/Condition_and_3.pm
  16. +2 −2 lib/Devel/Cover/Condition_or_2.pm
  17. +2 −2 lib/Devel/Cover/Condition_or_3.pm
  18. +2 −2 lib/Devel/Cover/Condition_xor_4.pm
  19. +13 −13 lib/Devel/Cover/Criterion.pm
  20. +57 −31 lib/Devel/Cover/DB.pm
  21. +3 −3 lib/Devel/Cover/DB/File.pm
  22. +4 −4 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. +17 −9 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. +65 −18 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. +1 −1 test_output/cover/alias.5.006001
  37. +0 −57 test_output/cover/alias.5.008
  38. +0 −57 test_output/cover/alias.5.008001
  39. +1 −1 test_output/cover/alias1.5.006001
  40. +0 −82 test_output/cover/alias1.5.008
  41. +0 −82 test_output/cover/alias1.5.008001
  42. +1 −1 test_output/cover/branch_return_sub.5.006001
  43. +0 −68 test_output/cover/branch_return_sub.5.008
  44. +0 −68 test_output/cover/branch_return_sub.5.008001
  45. +1 −1 test_output/cover/cond_and.5.006001
  46. +0 −111 test_output/cover/cond_and.5.008
  47. +1 −1 test_output/cover/cond_and.5.008001
  48. +1 −1 test_output/cover/cond_branch.5.006001
  49. +0 −482 test_output/cover/cond_branch.5.008
  50. +1 −1 test_output/cover/cond_branch.5.008001
  51. +1 −1 test_output/cover/cond_or.5.006001
  52. +0 −106 test_output/cover/cond_or.5.008
  53. +1 −1 test_output/cover/cond_or.5.008001
  54. +1 −1 test_output/cover/cond_xor.5.006001
  55. +0 −57 test_output/cover/cond_xor.5.008
  56. +1 −1 test_output/cover/cond_xor.5.008001
  57. +1 −1 test_output/cover/destroy.5.006001
  58. +0 −49 test_output/cover/destroy.5.008
  59. +0 −49 test_output/cover/destroy.5.008001
  60. +0 −78 test_output/cover/do.5.006001
  61. +0 −78 test_output/cover/do.5.008
  62. +0 −78 test_output/cover/do.5.008001
  63. +69 −19 test_output/cover/dynamic_subs.5.006001
  64. +0 −79 test_output/cover/dynamic_subs.5.008
  65. +68 −18 test_output/cover/dynamic_subs.5.008001
  66. +130 −0 test_output/cover/dynamic_subs.5.009
  67. +1 −1 test_output/cover/eval1.5.006001
  68. +0 −51 test_output/cover/eval1.5.008
  69. +0 −51 test_output/cover/eval1.5.008001
  70. +1 −1 test_output/cover/if.5.006001
  71. +0 −74 test_output/cover/if.5.008
  72. +0 −74 test_output/cover/if.5.008001
  73. +1 −1 test_output/cover/module1.5.006001
  74. +0 −130 test_output/cover/module1.5.008
  75. +1 −1 test_output/cover/module1.5.008001
  76. +1 −1 test_output/cover/module2.5.006001
  77. +0 −130 test_output/cover/module2.5.008
  78. +1 −1 test_output/cover/module2.5.008001
  79. +1 −1 test_output/cover/module_import.5.006001
  80. +1 −1 test_output/cover/module_import.5.008
  81. +1 −1 test_output/cover/module_import.5.008001
  82. +46 −0 test_output/cover/module_no_inc.5.006001
  83. +1 −1 test_output/cover/overloaded.5.006001
  84. +0 −58 test_output/cover/overloaded.5.008
  85. +0 −58 test_output/cover/overloaded.5.008001
  86. +1 −1 test_output/cover/pod.5.006001
  87. +41 −0 test_output/cover/pod.5.006002
  88. +1 −1 test_output/cover/pod.5.008
  89. +41 −0 test_output/cover/pod.5.008003
  90. +1 −1 test_output/cover/{pod.5.008001 → pod.5.009}
  91. +41 −0 test_output/cover/pod.5.009001
  92. +54 −0 test_output/cover/skip.5.006001
  93. +1 −1 test_output/cover/special_blocks.5.006001
  94. +0 −51 test_output/cover/special_blocks.5.008
  95. +0 −51 test_output/cover/special_blocks.5.008001
  96. +1 −1 test_output/cover/statement.5.006001
  97. +0 −29 test_output/cover/statement.5.008001
  98. +1 −1 test_output/cover/t0.5.006001
  99. +0 −83 test_output/cover/t0.5.008
  100. +1 −1 test_output/cover/t0.5.008001
  101. +1 −1 test_output/cover/t1.5.006001
  102. +0 −44 test_output/cover/t1.5.008
  103. +0 −44 test_output/cover/t1.5.008001
  104. +1 −1 test_output/cover/t2.5.006001
  105. +0 −77 test_output/cover/t2.5.008
  106. +1 −1 test_output/cover/t2.5.008001
  107. +4 −7 test_output/cover/{statement.5.008 → trivial.5.006001}
  108. +35 −2 tests/dynamic_subs
  109. +63 −0 tests/md5.t
  110. +21 −0 tests/skip
  111. +10 −0 tests/trivial
View
@@ -208,3 +208,18 @@ Release 0.33 - 13th January 2004
Release 0.34 - 14th January 2004
- Fix various warnings and errors that had crept in whilst working on
dynamic subs.
+
+Release 0.35 -
+ - Change Text2 to pick up version changes.
+ - Minor documentation updates.
+ - Minor changes to Devel::Cover::Op.
+ - Add outputfile option to HTML output (David Wheeler).
+ - Document -silent option to Devel::Cover.
+ - Add -silent option to cover (David Wheeler).
+ - Make Devel::Cover taint safe, or tolerant at least.
+ - Only add versioned golden results to tests that need them.
+ - Add trivial, md5 and module_no_inc tests.
+ - Increase flexibility of testing system to accomodate md5 test.
+ - Add mani, all_gold and all_test Makefile targets.
+ - Make all_versions skip non-existent platforms.
+ - Add DB option to make dump target.
View
@@ -55,13 +55,12 @@ static HV *Cover_hv,
static OP *Profiling_op = 0;
-typedef int seq_t;
-#define ch_sz (sizeof(void *) + sizeof(seq_t))
+#define ch_sz (sizeof(void *) + sizeof(PADOFFSET))
struct unique /* Well, we'll be fairly unlucky if it's not */
{
void *addr;
- seq_t seq;
+ PADOFFSET pad;
};
union sequence /* Hack, hack, hackety hack. */
@@ -86,25 +85,27 @@ extern "C" {
}
#endif
-#ifdef WIN32
-typedef double elapsed_type;
-#else
-typedef int elapsed_type;
-#endif
-
-static elapsed_type elapsed()
+static double get_elapsed()
{
- static struct timeval time;
- static int sec = 0,
- usec = 0;
- elapsed_type e;
+ struct timeval time;
+ double e;
gettimeofday(&time, NULL);
- e = (time.tv_sec - sec) * 1e6 + time.tv_usec - usec;
- sec = time.tv_sec;
- usec = time.tv_usec;
+ e = time.tv_sec * 1e6 + time.tv_usec;
- /* fprintf(stderr, "[[[%d]]]\n", sec * 1e6 + usec); */
+ /* fprintf(stderr, "[[[%f]]]\n", e); */
+
+ return e;
+}
+
+static double elapsed()
+{
+ static double p;
+ double e, t;
+
+ t = get_elapsed();
+ e = t - p;
+ p = t;
return e;
}
@@ -152,10 +153,10 @@ static char *get_key(OP *o)
static union sequence uniq;
uniq.op.addr = o;
- uniq.op.seq = o->op_seq;
+ uniq.op.pad = o->op_targ;
uniq.ch[ch_sz] = 0;
- NDEB(D(L, "0x%x %d => <%s>\n", o, o->op_seq, uniq.ch));
+ NDEB(D(L, "0x%x 0x%x => <%s>\n", o, o->op_targ, uniq.ch));
return uniq.ch;
}
@@ -336,8 +337,8 @@ static OP *get_condition(pTHX)
else
{
Perl_croak(aTHX_
- "All is lost, I know not where to go from %p, %d: %p\n",
- PL_op, PL_op->op_seq, sv);
+ "All is lost, I know not where to go from %p, %p: %p\n",
+ PL_op, PL_op->op_targ, sv);
}
return PL_op;
@@ -466,8 +467,8 @@ static void cover_logop()
cond = newSViv((IV) PL_op);
av_push(conds, cond);
- NDEB(D(L, "Adding conditional %p to %d, making %d\n",
- next, next->op_seq, av_len(conds)));
+ NDEB(D(L, "Adding conditional %p to %p, making %d\n",
+ next, next->op_targ, av_len(conds)));
NDEB(svdump(Pending_conditionals));
NDEB(op_dump(PL_op));
NDEB(op_dump(next));
@@ -807,6 +808,9 @@ coverage_all()
OUTPUT:
RETVAL
+double
+get_elapsed()
+
SV *
coverage()
CODE:
View
@@ -33,6 +33,9 @@ gcov2perl
create_gold
cpancover
all_versions
+lib/Devel/Cover/Tutorial.pod
+session.vim
+META.yml Module meta-data (added by MakeMaker)
tests/alias
tests/alias1
tests/branch_return_sub
@@ -49,81 +52,56 @@ tests/module2
tests/module_import
tests/overloaded
tests/pod
+tests/skip
tests/special_blocks
tests/statement
tests/t0
tests/t1
tests/t2
+tests/trivial
tests/Alias1.pm
tests/Module1.pm
tests/Module2.pm
tests/Module_import.pm
-test_output/cover/branch_return_sub.5.006001
-test_output/cover/branch_return_sub.5.008
-test_output/cover/branch_return_sub.5.008001
+tests/md5.t
test_output/cover/alias.5.006001
-test_output/cover/alias.5.008
-test_output/cover/alias.5.008001
test_output/cover/alias1.5.006001
-test_output/cover/alias1.5.008
-test_output/cover/alias1.5.008001
+test_output/cover/branch_return_sub.5.006001
test_output/cover/cond_and.5.006001
-test_output/cover/cond_and.5.008
test_output/cover/cond_and.5.008001
test_output/cover/cond_branch.5.006001
-test_output/cover/cond_branch.5.008
test_output/cover/cond_branch.5.008001
test_output/cover/cond_or.5.006001
-test_output/cover/cond_or.5.008
test_output/cover/cond_or.5.008001
test_output/cover/cond_xor.5.006001
-test_output/cover/cond_xor.5.008
test_output/cover/cond_xor.5.008001
test_output/cover/destroy.5.006001
-test_output/cover/destroy.5.008
-test_output/cover/destroy.5.008001
-test_output/cover/do.5.006001
-test_output/cover/do.5.008
-test_output/cover/do.5.008001
test_output/cover/dynamic_subs.5.006001
-test_output/cover/dynamic_subs.5.008
test_output/cover/dynamic_subs.5.008001
+test_output/cover/dynamic_subs.5.009
test_output/cover/eval1.5.006001
-test_output/cover/eval1.5.008
-test_output/cover/eval1.5.008001
test_output/cover/if.5.006001
-test_output/cover/if.5.008
-test_output/cover/if.5.008001
test_output/cover/module1.5.006001
-test_output/cover/module1.5.008
test_output/cover/module1.5.008001
test_output/cover/module2.5.006001
-test_output/cover/module2.5.008
test_output/cover/module2.5.008001
test_output/cover/module_import.5.006001
test_output/cover/module_import.5.008
test_output/cover/module_import.5.008001
+test_output/cover/module_no_inc.5.006001
test_output/cover/overloaded.5.006001
-test_output/cover/overloaded.5.008
-test_output/cover/overloaded.5.008001
test_output/cover/pod.5.006001
+test_output/cover/pod.5.006002
test_output/cover/pod.5.008
-test_output/cover/pod.5.008001
+test_output/cover/pod.5.008003
+test_output/cover/pod.5.009
+test_output/cover/pod.5.009001
+test_output/cover/skip.5.006001
test_output/cover/special_blocks.5.006001
-test_output/cover/special_blocks.5.008
-test_output/cover/special_blocks.5.008001
test_output/cover/statement.5.006001
-test_output/cover/statement.5.008
-test_output/cover/statement.5.008001
test_output/cover/t0.5.006001
-test_output/cover/t0.5.008
test_output/cover/t0.5.008001
test_output/cover/t1.5.006001
-test_output/cover/t1.5.008
-test_output/cover/t1.5.008001
test_output/cover/t2.5.006001
-test_output/cover/t2.5.008
test_output/cover/t2.5.008001
-lib/Devel/Cover/Tutorial.pod
-session.vim
-META.yml Module meta-data (added by MakeMaker)
+test_output/cover/trivial.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.34
+version: 0.35
version_from:
installdirs: site
requires:
View
@@ -13,29 +13,27 @@ use strict;
use warnings;
use Cwd;
-
use ExtUtils::MakeMaker;
use ExtUtils::Manifest "maniread";
+use File::Copy;
$| = 1;
-my $Version = "0.34";
-my $Date = "14th January 2004";
-my $Author = 'pjcj@cpan.org';
-
-my @perlbug = ("perlbug", "-a", $Author,
- "-s", "Installation of Devel::Cover $Version");
-my $Perlbug = join " ", map { / / ? "'$_'" : $_ } @perlbug;
+my $Version = "0.35";
+my $Date = "8th March 2004";
+my $Author = 'pjcj@cpan.org';
-my @files = sort keys %{maniread()}, "lib/Devel/Cover/Inc.pm";
-my @versions = grep { $_ ne "README" && $_ ne "Makefile.PL" } @files;
+my @perlbug = ("perlbug", "-a", $Author,
+ "-s", "Installation of Devel::Cover $Version");
+my $Perlbug = join " ", map { / / ? "'$_'" : $_ } @perlbug;
-my $test_version = $ENV{__COVER_GOLDEN_VERSION} || $];
+my @files = sort keys %{maniread()}, "lib/Devel/Cover/Inc.pm";
+my @versions = grep { $_ ne "README" && $_ ne "Makefile.PL" } @files;
-my $base = getcwd;
+my $base = getcwd;
-my %inc = map { $_ => 1 } @INC;
-my @inc = sort keys %inc;
+my %inc = map { $_ => 1 } @INC;
+my @inc = sort keys %inc;
open I, ">lib/Devel/Cover/Inc.pm"
or die "Cannot open lib/Devel/Cover/Inc.pm: $!";
@@ -76,6 +74,13 @@ for my $t (readdir D)
next unless -f "tests/$t";
next if $t =~ /\.(pm|pl|version|org|bak)$/;
next if $t =~ /~$/;
+
+ if ($t =~ /\.t/)
+ {
+ copy("tests/$t", "t/$t") or die "Cannot copy tests/$t to t/$t: $!";
+ next
+ }
+
open T, ">t/a$t.t" or die "Cannot open t/a$t.t: $!";
print T <<EOT;
#!$^X
@@ -191,7 +196,7 @@ else
print "not found\n\n$e\n";
}
-my $latest_tested = 5.008002;
+my $latest_tested = 5.008003;
print <<EOM if $] > $latest_tested;
Devel::Cover $Version has not been tested with perl $].
@@ -287,26 +292,42 @@ ppm : ppd pure_all
-e 's/(CODEBASE HREF=")[^"]*/\$\$1Gedcom.tar.gz/;' \\
Devel-Cover.ppd
+TAINT = -T
+
_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) && \\
+\t \$(PERL) \$(TAINT) -Iblib/lib -Iblib/arch -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
run : _run
\t \$(PERL) -Mblib cover && \\
gvim -d \$(TEST).out
-__COVER_GOLDEN_VERSION = $test_version
+DB = cover_db
+
+dump :
+\t \$(PERL) -Mblib cover -dump_db \$(DB)
FONT = 8x13
FONT = -sun-screen-medium-r-normal-*-*-70-*-*-m-*-sun-fontspecific
FONT = "Bitstream Vera Sans Mono 8"
diff : _run
-\t gvim -d -font \$(FONT) test_output/cover/\$(TEST).\$(__COVER_GOLDEN_VERSION) \$(TEST).out
+\t \$(PERL) -i -pe '\$\$t = index \$\$_, "time code" if !defined \$\$t || \$\$t < 0; substr \$\$_, \$\$t, 7, "" if /^line err stmt/ .. /^Branches/ and length > \$\$t' \$(TEST).out
+\t gvim -d -font \$(FONT) `\$(PERL) -Mblib -MDevel::Cover::Test -e '\$\$t = Devel::Cover::Test->new(\$(TEST)); print \$\$t->cover_gold'` \$(TEST).out
gold : pure_all
\t \$(PERL) create_gold \$(TEST)
+all_test :
+\t exec \$(PERL) all_versions make test
+
+all_gold :
+\t rm -rf test_output
+\t exec \$(PERL) all_versions make gold
+
+mani :
+\t \$(PERL) -i.bak -ne '\$\$d = "test_output/cover"; print unless /^\$\$d/; END { open M, ">>MANIFEST"; opendir D, \$\$d; print M "\$\$d/\$\$_\\n" for sort grep -f "\$\$d/\$\$_" && !/\.version\$\$/, readdir D }' MANIFEST
+
ok :
\t \@$Perlbug -okay || echo "Please send your report manually to $Author"
View
@@ -21,3 +21,7 @@
- Fix up html_basic and html_subtle for subs.
- Sort out time coverage on Windows.
- Marking of unreachable code - commandline tool and gui.
+- Threads support.
+- Test analysis.
+- Move HTML version and platform info to main page and allow for multiples.
+- Handle "my $x = shift || []" nicely.
View
@@ -28,8 +28,11 @@ sub get_options
ignore_failure!
version=s
));
- $Options->{version} = [ qw( 5.6.1 5.6.2 5.8.0 5.8.1 5.8.2 5.9.0 ) ]
+ $Options->{version} =
+ [ qw( 5.6.1 5.6.2 5.8.0 5.8.1 5.8.2 5.8.3 5.9.0 5.9.1 ) ]
unless @{$Options->{version}};
+ $Options->{version} =
+ [ grep eval { !system "perl$_ -v" }, @{$Options->{version}} ];
}
sub sys
Oops, something went wrong.

0 comments on commit 9f93b0b

Please sign in to comment.