Skip to content

Commit

Permalink
Fix for perls older than 5.20
Browse files Browse the repository at this point in the history
  • Loading branch information
exodist committed Apr 11, 2024
1 parent f46ca94 commit 860b31b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 9 deletions.
2 changes: 0 additions & 2 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ my %WriteMakefileArgs = (
"JSON::PP" => 0,
"Linux::Inotify2" => "2.3",
"List::Util" => "1.56",
"Long::Jump" => "0.000001",
"POSIX" => 0,
"Scalar::Util" => 0,
"Scope::Guard" => 0,
Expand Down Expand Up @@ -148,7 +147,6 @@ my %FallbackPrereqs = (
"JSON::PP" => 0,
"Linux::Inotify2" => "2.3",
"List::Util" => "1.56",
"Long::Jump" => "0.000001",
"POSIX" => 0,
"Scalar::Util" => 0,
"Scope::Guard" => 0,
Expand Down
2 changes: 1 addition & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ requires "Importer" => "0.025";
requires "JSON::PP" => "0";
requires "Linux::Inotify2" => "2.3";
requires "List::Util" => "1.56";
requires "Long::Jump" => "0.000001";
requires "POSIX" => "0";
requires "Scalar::Util" => "0";
requires "Scope::Guard" => "0";
Expand Down Expand Up @@ -72,6 +71,7 @@ suggests "HTTP::Tiny" => "0.070";
suggests "HTTP::Tiny::Multipart" => "0.08";
suggests "IO::Pager" => "1.00";
suggests "Linux::Inotify2" => "0";
suggests "System::Info" => "0.064";
suggests "Term::ANSIColor" => "4.03";
suggests "Test2::Plugin::Cover" => "0.000025";
suggests "Test2::Plugin::DBIProfile" => "0.002002";
Expand Down
1 change: 0 additions & 1 deletion dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ Importer = 0.025
JSON::PP = 0
Linux::Inotify2 = 2.3
List::Util = 1.56
Long::Jump = 0.000001
POSIX = 0
Scalar::Util = 0
Scope::Guard = 0
Expand Down
6 changes: 4 additions & 2 deletions lib/App/Yath/Options/Resource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ sub jobs_post_process {

my $settings = $state->{settings};
my $resource = $settings->resource;
$resource->field(slots => 1) unless $resource->slots;
$resource->field(job_slots => 1) unless $resource->job_slots;
$resource->option(slots => 1) unless $resource->slots;
$resource->option(job_slots => 1) unless $resource->job_slots;

my $slots = $resource->slots;
my $job_slots = $resource->job_slots;

die "The slots per job (set to $job_slots) must not be larger than the total number of slots (set to $slots).\n" if $job_slots > $slots;

$resource->option(classes => {}) unless $resource->classes;

my %found;
for my $r (keys %{$resource->classes}) {
require(mod2file($r));
Expand Down
2 changes: 2 additions & 0 deletions lib/App/Yath/Options/Run.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ option_group {group => 'run', category => "Run Options"} => sub {
my $opt = shift;
my %params = @_;

$params{settings}->tests->option(env_vars => {}) unless $params{settings}->tests->env_vars;

if ($params{action} eq 'set') {
$params{settings}->tests->env_vars->{AUTHOR_TESTING} = 1;
}
Expand Down
1 change: 1 addition & 0 deletions lib/App/Yath/Options/Term.pm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ option_post_process sub {

if ($settings->check_group('tests')) {
my $tests = $settings->tests;
$tests->option(env_vars => {}) unless $tests->env_vars;
$tests->env_vars->{TABLE_TERM_SIZE} = $term->width if defined $term->width;
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/Test2/Harness/IPC/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ sub start_process {

$post_fork->() if $post_fork;

no warnings "exec";
no warnings;
my $ok = eval { exec(@$cmd); 1 };
my $err = $@;
print STDERR longmess("Failed to exec ($!) $@\n");
Expand Down
2 changes: 1 addition & 1 deletion lib/Test2/Harness/Run/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ sub launch_command {

if ($self->test_file->non_perl) {
$run_file = "./$run_file" unless $run_file =~ m{^[/\.]};
return ([$run_file, @{$ts->args // []}], {PERL5LIB => join $Config{path_sep} => @includes});
return ([$run_file, @{$ts->args // []}], {PERL5LIB => join $Config{path_sep} => @includes, $ENV{PERL5LIB}});
}

@includes = map { "-I$_" } @includes;
Expand Down
4 changes: 3 additions & 1 deletion t/JUnit/test.t
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ use Test2::Plugin::NoWarnings;

use XML::Simple ();

$ENV{TABLE_TERM_SIZE} = 200;

my $tmpdir = File::Temp->newdir();

my $dir = __FILE__;
Expand All @@ -29,7 +31,7 @@ my @renderers = qw{--renderer=JUnit};
delete $ENV{JUNIT_TEST_FILE}; # make sure it's not defined

my $env = { # env passed to yath
PERL5LIB => "$FindBin::Bin/../../lib",
PERL5LIB => "$FindBin::Bin/../../lib:$ENV{PERL5LIB}",
};

{
Expand Down

0 comments on commit 860b31b

Please sign in to comment.