Permalink
Browse files

Allow tests to run in parallel

Every e2e test gets its own directory for its coverdb in
t/e2e/cover_db_${test_name}, stopping them from interacting with each other, and
avoiding very much non-obvious fail.
  • Loading branch information...
1 parent dd77f6b commit 27b318f06650ee2ab2756ac7de8ea1828fcfaa4a @rafl rafl committed Aug 9, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Devel/Cover/Test.pm
View
@@ -70,9 +70,11 @@ sub get_params
. " -merge 0 -coverage $self->{criteria} "
. ($self->{test_parameters} || "");
$self->{criteria} =~ s/-\w+//g;
+ $self->{cover_db} = "$Devel::Cover::Inc::Base/t/e2e/cover_db_$self->{test}/";
+ mkdir $self->{cover_db};
$self->{cover_parameters} = join(" ", map "-coverage $_",
split " ", $self->{criteria})
- . " -report text";
+ . " -report text " . $self->{cover_db};
$self->{cover_parameters} .= " -uncoverable_file $self->{uncoverable_file}"
if $self->{uncoverable_file};
$self->{skip} = $self->{skip_reason}
@@ -111,7 +113,7 @@ sub test_command
unless ($ENV{DEVEL_COVER_NO_COVERAGE})
{
$c .= " -MDevel::Cover=" .
- join(",", split ' ', $self->{test_parameters})
+ join(",", '-db', $self->{cover_db}, split ' ', $self->{test_parameters})
}
$c .= " " . shell_quote $self->test_file;
$c .= " " . $self->test_file_parameters;

0 comments on commit 27b318f

Please sign in to comment.