Skip to content

Commit 3ca3bc5

Browse files
Use environment variable for jobs in test.pl
1 parent 1e7f2bc commit 3ca3bc5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

regression/test.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,15 @@ ($$$$)
304304
$main::VERSION = 0.1;
305305
$Getopt::Std::STANDARD_HELP_VERSION = 1;
306306
our ($opt_c, $opt_i, $opt_j, $opt_n, $opt_p, $opt_h, $opt_C, $opt_T, $opt_F, $opt_K, %defines, @include_tags, @exclude_tags); # the variables for getopt
307-
$opt_j = 0;
308307
GetOptions("D=s" => \%defines, "X=s" => \@exclude_tags, "I=s" => \@include_tags);
309308
getopts('c:i:j:nphCTFK') or &main::HELP_MESSAGE(\*STDOUT, "", $main::VERSION, "");
310309
$opt_c or &main::HELP_MESSAGE(\*STDOUT, "", $main::VERSION, "");
311-
(!$opt_j || $has_thread_pool) or &main::HELP_MESSAGE(\*STDOUT, "", $main::VERSION, "");
310+
$opt_j = $opt_j || $ENV{'TESTPL_JOBS'} || 0;
311+
if($opt_j && $opt_j != 1 && !$has_thread_pool) {
312+
warn "Jobs set but thread pool module not found,\n"
313+
. "install with 'cpan -i Thread::Pool::Simple'\n"
314+
. "Or avoid setting the -j parameter or the TESTPL_JOBS variable\n";
315+
}
312316
$opt_h and &main::HELP_MESSAGE(\*STDOUT, "", $main::VERSION, "");
313317
my $t_level = 0;
314318
$t_level += 2 if($opt_T);

0 commit comments

Comments
 (0)