Skip to content
Browse files

Add and use nice_cpus function.

Try to leave a little bit for everyone else to use.
  • Loading branch information...
1 parent 7aed40f commit 9bed3bc7db62edb06a3a66d290539fd67ecc3330 @pjcj committed Aug 4, 2012
Showing with 11 additions and 4 deletions.
  1. +1 −1 Makefile.PL
  2. +10 −3 utils/Devel/Cover/BuildUtils.pm
View
2 Makefile.PL
@@ -421,7 +421,7 @@ prove : pure_all
\t \$(PERL) -Iutils -MDevel::Cover::BuildUtils=prove_command -le '\$\$c = prove_command and print \$\$c and system \$\$c'
t : pure_all
-\t exec make test HARNESS_OPTIONS=j`\$(PERL) -Iutils -MDevel::Cover::BuildUtils=cpus -e 'print cpus'`:c HARNESS_TIMER=1
+\t exec make test HARNESS_OPTIONS=j`\$(PERL) -Iutils -MDevel::Cover::BuildUtils=nice_cpus -e 'print nice_cpus'`:c HARNESS_TIMER=1
DB = cover_db
View
13 utils/Devel/Cover/BuildUtils.pm
@@ -15,7 +15,7 @@ use warnings;
use Exporter;
our @ISA = "Exporter";
-our @EXPORT_OK = qw(find_prove cpus prove_command);
+our @EXPORT_OK = qw(find_prove cpus nice_cpus rove_command);
sub find_prove
{
@@ -43,11 +43,18 @@ sub cpus
$cpus
}
+sub nice_cpus
+{
+ my $cpus = cpus;
+ $cpus-- if $cpus > 3;
+ $cpus-- if $cpus > 6;
+ $cpus
+}
+
sub prove_command
{
my $prove = find_prove or return;
- my $cpus = cpus;
- $cpus-- if $cpus > 4;
+ my $cpus = nice_cpus;
"$prove -brj$cpus t"
}

0 comments on commit 9bed3bc

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