From 16d8e387fbd912328119cf50ebb641ee3a41334c Mon Sep 17 00:00:00 2001 From: Chad Granum Date: Wed, 31 Jul 2024 14:15:25 -0700 Subject: [PATCH] Fix and require 5.14 Fixed issues breaking on perl 5.14 Bumped minimum version to 5.14. I did this because I cannot install all required dependency on older perls. It *may* work on older perls, but I cannot easily test them, so I am cutting things off at 5.14. If anyone needs this module on older perls I will accept patches. --- Changes | 3 +++ dist.ini | 2 +- lib/App/Yath.pm | 1 + lib/App/Yath/Plugin/Cover.pm | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 2b80d4814..57e9a913a 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ {{$NEXT}} + - Fix 5.14 + - Bump min perl to 5.14 + 2.000001 2024-07-31 09:30:20-07:00 America/Los_Angeles (TRIAL RELEASE) - Fix some test issues diff --git a/dist.ini b/dist.ini index f5966fae1..2a4666c3d 100644 --- a/dist.ini +++ b/dist.ini @@ -61,7 +61,7 @@ repository.url = https://github.com/Test-More/Test2-Harness/ repository.type = git [Prereqs] -perl = 5.010000 +perl = 5.014000 base = 0 constant = 0 goto::file = 0.005 diff --git a/lib/App/Yath.pm b/lib/App/Yath.pm index 9a6e6cfde..280f17e71 100644 --- a/lib/App/Yath.pm +++ b/lib/App/Yath.pm @@ -484,6 +484,7 @@ sub process_args { for my $set (['yath', 'plugins', 'App::Yath::Plugin'], ['renderer', 'classes', 'App::Yath::Renderer'], ['resource', 'classes', 'App::Yath::Resource']) { my ($group, $field, $type) = @$set; next unless $module->isa($type); + $settings->$group->option($field => {}) unless $settings->$group->$field; my $args = $settings->$group->$field->{$module} //= []; next unless $module->can('args_from_settings'); push @$args => $module->args_from_settings(settings => $settings, args => $args, group => $group, field => $field, type => $type); diff --git a/lib/App/Yath/Plugin/Cover.pm b/lib/App/Yath/Plugin/Cover.pm index dc0a3a4a3..9771d4b89 100644 --- a/lib/App/Yath/Plugin/Cover.pm +++ b/lib/App/Yath/Plugin/Cover.pm @@ -126,11 +126,13 @@ sub post_process { my $cover_class = $cover->class // 'Test2::Plugin::Cover'; eval { require(mod2file($cover_class)); 1 } or die "Could not enable file coverage, could not load '$cover_class': $@"; + $tests->option(load_import => {}) unless $tests->load_import; push @{$tests->load_import->{'@'}} => $cover_class; $tests->load_import->{$cover_class} = []; if ($settings->check_group('runner')) { my $runner = $settings->runner; + $runner->option(preload_early => {}) unless $runner->preload_early; unshift @{$runner->preload_early->{'@'}} => $cover_class; $runner->preload_early->{$cover_class} = [disabled => 1]; }