allow coverage testing to test only .c code coverage
authorTony Cook <tony@develop-help.com>
Thu, 25 Oct 2012 03:39:06 +0000 (14:39 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 24 Nov 2012 04:05:55 +0000 (15:05 +1100)
this allows me to test coverage of code only tested by threading,
since Devel::Cover and ithreads don't (or didn't) get along well.

imcover.perl

index b311a24..86d8703 100644 (file)
@@ -7,7 +7,9 @@ use Getopt::Long;
 
 my @tests;
 my $verbose;
+my $nodc;
 GetOptions("t|test=s" => \@tests,
+          "n" => \$nodc,
           "v" => \$verbose)
   or die;
 
@@ -25,7 +27,8 @@ run("$make 'OTHERLDFLAGS=-ftest-coverage -fprofile-arcs'")
 
 {
   local $ENV{DEVEL_COVER_OPTIONS} = "-db," . getcwd() . "/cover_db,-coverage,statement,branch,condition,subroutine";
-  my $makecmd = "$make test TEST_VERBOSE=1 HARNESS_PERL_SWITCHES=-MDevel::Cover";
+  my $makecmd = "$make test TEST_VERBOSE=1";
+  $makecmd .= " HARNESS_PERL_SWITCHES=-MDevel::Cover" unless $nodc;
   if (@tests) {
     $makecmd .= " TEST_FILES='@tests'";
   }