Previously it took a second argument as a reason to show in the skip_all
message, if the config option was not set. However, no callers were using it,
so remove it. This allows skip_all_without_config() to take a list of keys
to test, which is useful to two of its callers.
use Config;
BEGIN {
- skip_all_without_config($_) foreach qw(useithreads d_getppid);
+ skip_all_without_config(qw(useithreads d_getppid));
skip_all_if_miniperl("no dynamic loading on miniperl, no threads");
eval 'use threads; use threads::shared';
plan tests => 3;
BEGIN {
require './test.pl';
- skip_all_without_config($_) foreach qw(d_pipe d_fork d_waitpid d_getppid);
+ skip_all_without_config(qw(d_pipe d_fork d_waitpid d_getppid));
plan (8);
}
}
sub skip_all_without_config {
- my ($key, $reason) = @_;
unless (eval 'require Config; 1') {
warn "test.pl had problems loading Config: $@";
return;
}
- return if $Config::Config{$key};
- unless (defined $reason) {
+ foreach (@_) {
+ next if $Config::Config{$_};
+ my $key = $_; # Need to copy, before trying to modify.
$key =~ s/^use//;
$key =~ s/^d_//;
- $reason = "no $key";
+ skip_all("no $key");
}
- skip_all($reason);
}
sub _ok {