Permalink
Browse files

Calculate number of tests to run in parallel.

Based on the number of CPUs available.

Also, fall back to make test if prove fails.
(Early versions did not support -j.)
  • Loading branch information...
1 parent 162e396 commit 741cc5568fae6b7b5ab678197544dd0970d6cef0 @pjcj committed Aug 11, 2010
Showing with 9 additions and 1 deletion.
  1. +9 −1 all_versions
View
@@ -76,7 +76,15 @@ for my $v (@{$Options->{version}})
($dir) = $l =~ m|(.*)/[^/]+|;
};
my ($prove) = grep -x, "$dir/prove", "$dir/prove$v";
- $c = $prove ? "$prove -b -r -j6 t" : "make test";
+ if ($prove)
+ {
+ my $cpus = 1;
+ eval { chomp ($cpus = `grep -c processor /proc/cpuinfo`); };
+ $c = "$prove -b -r -j$cpus t";
+ eval { sys $c, 1 };
+ next unless $@;
+ }
+ $c = "make test";
}
sys $c, 1;
}

0 comments on commit 741cc55

Please sign in to comment.