4 use ExtUtils::Manifest 'maniread';
7 my $make = $Config{make};
8 # if there's a way to make with profiling for a recursive build like
9 # Imager I don't see how
13 system "cover -delete";
14 system "perl Makefile.PL --coverage"
16 system "$make 'OTHERLDFLAGS=-ftest-coverage -fprofile-arcs'"
20 local $ENV{DEVEL_COVER_OPTIONS} = "-db," . getcwd() . "/cover_db";
21 system "$make test TEST_VERBOSE=1 HARNESS_PERL_SWITCHES=-MDevel::Cover";
25 my $mani = maniread();
28 for my $filename (keys %$mani) {
29 next unless $filename =~ /\.(xs|c|im)$/;
30 if ($filename =~ m!^(\w+)/(\w+\.\w+)$!) {
31 push @{$paths{$1}}, $2;
34 push @{$paths{''}}, $filename;
38 for my $path (keys %paths) {
40 system "cd $path ; gcov @{$paths{$path}} ; cd ..";
43 system "gcov @{$paths{$path}}";
45 my $dir = $path ? $path : '.';
46 for my $file (@{$paths{$path}}) {
47 system "gcov2perl $dir/$file.gcov";
51 my @dbs = "cover_db", map "$_/cover_db", grep $_, keys %paths;
52 system "cover -ignore_re '^t/'";