From cec1692c8efb7afdbde9f21e90ca2fc681eccc29 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 28 Apr 2020 20:40:01 +0200 Subject: split set_path() --- t/02create_pkgs.t | 3 +-- t/helper.pm | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/02create_pkgs.t b/t/02create_pkgs.t index c0af4f3f..9733436c 100644 --- a/t/02create_pkgs.t +++ b/t/02create_pkgs.t @@ -6,8 +6,7 @@ use helper; use Test::More 'no_plan'; use Cwd; -# help CPAN testers who installed genhdlist2 using cpan but do not have /usr/local/bin in their PATH: -$ENV{PATH} .= ":/usr/local/bin"; +set_path(); chdir 't' if -d 't'; system('rm -rf tmp media'); diff --git a/t/helper.pm b/t/helper.pm index 947cdeaa..451311d9 100644 --- a/t/helper.pm +++ b/t/helper.pm @@ -10,11 +10,16 @@ our @EXPORT = qw(need_root_and_prepare need_downloader urpmi_addmedia urpmi_removemedia urpmi_update urpm_cmd run_urpm_cmd urpmi_cmd urpmi urpmi_partial test_urpmi_fail urpme urpmi_cfg set_urpmi_cfg_global_options - system_ system_should_fail + set_path system_ system_should_fail check_installed_fullnames check_installed_names check_nothing_installed check_installed_and_remove check_installed_fullnames_and_remove check_installed_and_urpme ); +sub set_path() { + # help CPAN testers who installed genhdlist2 using cpan but do not have /usr/local/bin in their PATH: + $ENV{PATH} .= ":/usr/local/bin"; +} + my $using_root; sub need_root_and_prepare() { if ($< != 0) { -- cgit v1.2.1