complete-run: don’t parallelize more than the number of tests

This commit is contained in:
Michael Stapelberg
2011-12-17 11:19:31 +00:00
parent da8d0baa74
commit 81f4b6fc1a
2 changed files with 13 additions and 8 deletions

View File

@ -61,8 +61,16 @@ pod2usage(-verbose => 2, -exitcode => 0) if $help;
@displays = split(/,/, join(',', @displays));
@displays = map { s/ //g; $_ } @displays;
# 2: get a list of all testcases
my @testfiles = @ARGV;
# if no files were passed on command line, run all tests from t/
@testfiles = <t/*.t> if @testfiles == 0;
my $numtests = scalar @testfiles;
# No displays specified, lets start some Xdummy instances.
@displays = start_xdummy($parallel) if @displays == 0;
@displays = start_xdummy($parallel, $numtests) if @displays == 0;
# 1: create an output directory for this test-run
my $outdir = "testsuite-";
@ -96,12 +104,6 @@ for my $display (@displays) {
my $timingsjson = StartXDummy::slurp('.last_run_timings.json');
%timings = %{decode_json($timingsjson)} if length($timingsjson) > 0;
# 2: get a list of all testcases
my @testfiles = @ARGV;
# if no files were passed on command line, run all tests from t/
@testfiles = <t/*.t> if @testfiles == 0;
# Re-order the files so that those which took the longest time in the previous
# run will be started at the beginning to not delay the whole run longer than
# necessary.