complete-run: wait for all jobs to be finished

This commit is contained in:
Maik Fischer 2011-11-10 13:48:21 +01:00 committed by Michael Stapelberg
parent 4f2b1c3a66
commit af793c9030
1 changed files with 4 additions and 4 deletions

View File

@ -139,7 +139,7 @@ status_init(displays => \@wdisplays, tests => $num);
# We start tests concurrently: For each display, one test gets started. Every # We start tests concurrently: For each display, one test gets started. Every
# test starts another test after completing. # test starts another test after completing.
take_job($_) for @wdisplays; for (@wdisplays) { $cv->begin; take_job($_) }
# #
# Takes a test from the beginning of @testfiles and runs it. # Takes a test from the beginning of @testfiles and runs it.
@ -154,8 +154,8 @@ take_job($_) for @wdisplays;
sub take_job { sub take_job {
my ($display) = @_; my ($display) = @_;
my $test = shift @testfiles; my $test = shift @testfiles
return unless $test; or return $cv->end;
my $dont_start = (slurp($test) =~ /# !NO_I3_INSTANCE!/); my $dont_start = (slurp($test) =~ /# !NO_I3_INSTANCE!/);
my $basename = basename($test); my $basename = basename($test);
@ -288,7 +288,7 @@ sub take_job {
undef $_ for @watchers; undef $_ for @watchers;
if (@done == $num) { if (@done == $num) {
$cv->send; $cv->end;
} else { } else {
take_job($display); take_job($display);
} }