Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix occasional parallel test failures.

File::Find gives warnings when directories disappear from underneath it.
Teach the tests to ignore them.
  • Loading branch information...
commit 4d475ca4bb11e11b6691e0114d116ca71e19271f 1 parent 8c9c86f
@pjcj authored
Showing with 10 additions and 2 deletions.
  1. +4 −2 cover
  2. +6 −0 lib/Devel/Cover/Test.pm
View
6 cover
@@ -223,17 +223,19 @@ sub main
{
return unless /\.(xs|c|h)$/;
+ my ($name) = /([^\/]+$)/;
+
# Don't bother running gcov if there's no index files.
# Otherwise it's noisy.
my $graph_file = $_;
$graph_file =~ s{\.\w+$}{.gcno};
return unless -e $graph_file;
- my $c = "gcov $_";
+ my $c = "gcov $name";

This doesn't work for files in subdirectories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
print STDERR "cover: running $c\n";
system $c;
};
- File::Find::find({ wanted => $gc, no_chdir => 0 }, ".");
+ File::Find::find({ wanted => $gc, no_chdir => 1 }, ".");
my @gc;
my $gp = sub
{
View
6 lib/Devel/Cover/Test.pm
@@ -259,6 +259,12 @@ sub run_cover
print STDERR $_ if $debug;
redo if /^Devel::Cover: merging run/;
redo if /^Set up gcc environment/; # for MinGW
+ if (/Can't opendir\(.+\): No such file or directory/)
+ {
+ # parallel tests
+ scalar $get_line->();
+ redo;
+ }
s/^(Reading database from ).*/$1/;
s|(__ANON__\[) .* (/tests/ \w+ : \d+ \])|$1$2|x;
s/(Subroutine) +(Location)/$1 $2/;

2 comments on commit 4d475ca

@nwellnhof

This commit introduced a bug when you have .c files in subdirectories.

@pjcj
Owner

Thanks for the report.

Fixed with 24aa147.

Please sign in to comment.
Something went wrong with that request. Please try again.