@@ -257,6 +257,7 @@ ($$$$)
257
257
-c CMD run tests on CMD - required option
258
258
-i <regex> options in test.desc matching the specified perl regex are ignored
259
259
-j <num> run <num> tests in parallel (requires Thread::Pool::Simple)
260
+ if present, the environment variable TESTPL_JOBS is used as the default
260
261
-n dry-run: print the tests that would be run, but don't actually run them
261
262
-p print logs of each failed test (if any)
262
263
-h show this help and exit
@@ -304,11 +305,15 @@ ($$$$)
304
305
$main::VERSION = 0.1;
305
306
$Getopt::Std::STANDARD_HELP_VERSION = 1;
306
307
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;
308
308
GetOptions(" D=s" => \%defines , " X=s" => \@exclude_tags , " I=s" => \@include_tags );
309
309
getopts(' c:i:j:nphCTFK' ) or &main::HELP_MESSAGE(\*STDOUT , " " , $main::VERSION , " " );
310
310
$opt_c or &main::HELP_MESSAGE(\*STDOUT , " " , $main::VERSION , " " );
311
- (!$opt_j || $has_thread_pool ) or &main::HELP_MESSAGE(\*STDOUT , " " , $main::VERSION , " " );
311
+ $opt_j = $opt_j || $ENV {' TESTPL_JOBS' } || 0;
312
+ if ($opt_j && $opt_j != 1 && !$has_thread_pool ) {
313
+ warn " Jobs set but thread pool module not found,\n "
314
+ . " install with 'cpan -i Thread::Pool::Simple'\n "
315
+ . " Or avoid setting the -j parameter or the TESTPL_JOBS variable\n " ;
316
+ }
312
317
$opt_h and &main::HELP_MESSAGE(\*STDOUT , " " , $main::VERSION , " " );
313
318
my $t_level = 0;
314
319
$t_level += 2 if ($opt_T );
0 commit comments