Permalink
Browse files

Fix some nits with improve-coverage-option patch.

  • Loading branch information...
1 parent 860d58f commit edc3e5534c733041f2e21837eb1709b5be08461a @pjcj committed Jul 18, 2013
Showing with 24 additions and 24 deletions.
  1. +24 −24 bin/cover
View
@@ -86,34 +86,33 @@ sub get_options
Getopt::Long::Configure("nopass_through");
$Options->{report} ||= "html" unless exists $Options->{write};
- #handle comma seperated ops, like -coverage branch,statement
-
- @{$Options->{coverage}} = split(/,/,join(',', @{$Options->{coverage}} ));
-
- #also accept them in the same format they're output
- my %coverage_abbrev = (
- stmt => 'statement',
- bran => 'branch',
- cond => 'condition',
- sub => 'subroutine',
- );
+ # handle comma seperated ops, like -coverage branch,statement
+ @{$Options->{coverage}} = split(/,/, join(",", @{$Options->{coverage}}));
+
+ # also accept them in the same format they're output
+ my %coverage_abbrev =
+ (
+ stmt => 'statement',
+ bran => 'branch',
+ cond => 'condition',
+ sub => 'subroutine',
+ );
my %options_coverage = map {$_ => 1} @{$Options->{coverage}};
- while (my ($abbr, $full) = each %coverage_abbrev) {
- #push @{$Options->{coverage}}, $full if $options_coverage{$abbr};
- $options_coverage{$full} = delete $options_coverage{$abbr}
- if $options_coverage{$abbr};
+ while (my ($abbr, $full) = each %coverage_abbrev)
+ {
+ $options_coverage{$full} = delete $options_coverage{$abbr}
+ if $options_coverage{$abbr};
}
@{$Options->{coverage}} = keys %options_coverage;
- #generating data may take time, so bail now if options are wrong
- my %coverage_allowed = map {$_=>1}
- (values(%coverage_abbrev), 'time', 'pod');
- foreach my $cov ( @{$Options->{coverage}} ) {
- die "Unrecognized -coverage: $cov" unless $coverage_allowed{$cov};
+ # generating data may take time, so bail now if options are wrong
+ my %coverage_allowed = map {$_ => 1} values %coverage_abbrev, "time", "pod";
+ for my $cov (@{$Options->{coverage}})
+ {
+ die "Unrecognised -coverage: $cov" unless $coverage_allowed{$cov};
}
-
}
sub delete_db
@@ -278,9 +277,10 @@ sub main
my $gc = sub
{
return unless /\.(xs|cc?|hh?)$/;
- for my $re ( $Options->{ignore_re} ) {
- return if m/$re/;
- }
+ for my $re (@{$Options->{ignore_re}})
+ {
+ return if /$re/;
+ }
my ($name) = /([^\/]+$)/;
# Don't bother running gcov if there's no index files.

0 comments on commit edc3e55

Please sign in to comment.