From 621b807f0f82455160ce5be873dd4887e004668f Mon Sep 17 00:00:00 2001 From: Kang-min Liu Date: Sat, 31 Aug 2024 11:23:25 +0900 Subject: [PATCH 1/2] remove test_helpers.pl and those dependiencs that are no longer directly required --- cpanfile | 4 -- t/test_helpers.pl | 105 ---------------------------------------------- 2 files changed, 109 deletions(-) delete mode 100644 t/test_helpers.pl diff --git a/cpanfile b/cpanfile index 7571b47d..4ca6f92d 100644 --- a/cpanfile +++ b/cpanfile @@ -15,11 +15,7 @@ on test => sub { requires 'File::Which' => '1.21'; requires 'IO::All' => '0.51'; requires 'Path::Class' => '0.33'; - requires 'Test::More' => '1.001002'; - requires 'Test::NoWarnings' => '1.04'; requires 'Test::Output' => '1.03'; - requires 'Test::Simple' => '1.001002'; - requires 'Test::TempDir::Tiny' => '0.016'; requires 'Test2::V0' => '0.000163'; requires 'Test2::Plugin::NoWarnings' => '0.10'; requires 'Test2::Plugin::IOEvents' => '0.001001'; diff --git a/t/test_helpers.pl b/t/test_helpers.pl deleted file mode 100644 index 2322b4e4..00000000 --- a/t/test_helpers.pl +++ /dev/null @@ -1,105 +0,0 @@ -=begin yada yada - -Copy this snippet to the beginning of tests: - - use FindBin; - use lib $FindBin::Bin; - use App::perlbrew; - require 'test_helpers.pl'; - -tldr: This file should be `require`-ed after the "use App::perlbrew;" statement in -the test. It is meant to override subroutines for testing purposes and not -mess up developer's own perlbrew environment. `FindBin` should be used to -put 't/' dir to `@INC`. - -NOTE: If you are using Test2 in your test file, see test2_helpers.pl instead. - -=cut - -use strict; -use Test::More; -use IO::All; -use File::Temp qw( tempdir ); - -sub dir { - App::Perlbrew::Path->new(@_); -} - -sub file { - App::Perlbrew::Path->new(@_); -} - -$App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP => 1 ); -$App::perlbrew::PERLBREW_HOME = tempdir( CLEANUP => 1 ); -$ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT; - -delete $ENV{PERLBREW_LIB}; -delete $ENV{PERLBREW_PERL}; -delete $ENV{PERLBREW_PATH}; -delete $ENV{PERLBREW_MANPATH}; -delete $ENV{PERL_LOCAL_LIB_ROOT}; - -my $root = App::Perlbrew::Path::Root->new ($ENV{PERLBREW_ROOT}); -$root->perls->mkpath; -$root->build->mkpath; -$root->dists->mkpath; - -no warnings 'redefine'; - -sub App::perlbrew::do_install_release { - my ($self, $name) = @_; - - $name = $self->{as} if $self->{as}; - - my $root = $self->root; - my $installation_dir = $root->perls ($name); - - $self->{installation_name} = $name; - - $installation_dir->mkpath; - $root->perls($name, "bin")->mkpath; - - my $perl = $root->perls ($name, "bin")->child ("perl"); - io($perl)->print(<<'CODE'); -#!/usr/bin/env perl -use File::Basename; -my $name = basename(dirname(dirname($0))), "\n"; -$name =~ s/^perl-//; -my ($a,$b,$c) = split /\./, $name; -printf('%d.%03d%03d' . "\n", $a, $b, $c); -CODE - - chmod 0755, $perl; - - note "(mock) installed $name to $installation_dir"; -} - -sub mock_perlbrew_install { - my ($name, @args) = @_; - App::perlbrew->new(install => $name, @args)->run(); -} - -sub mock_perlbrew_off { - mock_perlbrew_use(""); -} - -sub mock_perlbrew_use { - my ($name) = @_; - - my %env = App::perlbrew->new()->perlbrew_env($name); - - for my $k (qw< PERLBREW_PERL PERLBREW_LIB PERLBREW_PATH PERL5LIB >) { - if (defined $env{$k}) { - $ENV{$k} = $env{$k}; - } else { - delete $ENV{$k} - } - } -} - -sub mock_perlbrew_lib_create { - my $name = shift; - App::Perlbrew::Path->new($App::perlbrew::PERLBREW_HOME, "libs", $name)->mkpath; -} - -1; From 45ba665d844e211eabd607423587a6c035561cae Mon Sep 17 00:00:00 2001 From: Kang-min Liu Date: Sat, 31 Aug 2024 11:25:45 +0900 Subject: [PATCH 2/2] `mbtiny regenerate` --- META.json | 6 +----- META.yml | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/META.json b/META.json index 565133d6..e72903fd 100644 --- a/META.json +++ b/META.json @@ -45,11 +45,7 @@ "Path::Class" : "0.33", "Test2::Plugin::IOEvents" : "0.001001", "Test2::Plugin::NoWarnings" : "0.10", - "Test2::V0" : "0.000163", - "Test::More" : "1.001002", - "Test::NoWarnings" : "1.04", - "Test::Simple" : "1.001002", - "Test::TempDir::Tiny" : "0.016" + "Test2::V0" : "0.000163" } } }, diff --git a/META.yml b/META.yml index 1a29ea43..20f81f69 100644 --- a/META.yml +++ b/META.yml @@ -9,10 +9,6 @@ build_requires: Test2::Plugin::IOEvents: '0.001001' Test2::Plugin::NoWarnings: '0.10' Test2::V0: '0.000163' - Test::More: '1.001002' - Test::NoWarnings: '1.04' - Test::Simple: '1.001002' - Test::TempDir::Tiny: '0.016' configure_requires: Module::Build::Tiny: '0.039' dynamic_config: 0