From 9f3d18d43e3fe4e6987fb4dd09a8760560372dbf Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 13 Aug 2014 12:43:11 +0200 Subject: Bug 996893: Perl 5.18 and newer throw tons of warnings about deprecated modules r=dkl a=sgreen --- t/Support/Files.pm | 18 ++++++++++++------ t/Support/Systemexec.pm | 5 +++++ t/Support/Templates.pm | 35 +++++++++++++---------------------- 3 files changed, 30 insertions(+), 28 deletions(-) (limited to 't/Support') diff --git a/t/Support/Files.pm b/t/Support/Files.pm index 330a473b1..85fa9f583 100644 --- a/t/Support/Files.pm +++ b/t/Support/Files.pm @@ -8,15 +8,19 @@ package Support::Files; +use 5.10.1; +use strict; +use warnings; + use File::Find; -@additional_files = (); +our @additional_files = (); -@files = glob('*'); +our @files = glob('*'); find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'Bugzilla'); push(@files, 'extensions/create.pl'); -@extensions = +our @extensions = grep { $_ ne 'extensions/create.pl' && ! -e "$_/disabled" } glob('extensions/*'); @@ -24,7 +28,7 @@ foreach my $extension (@extensions) { find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, $extension); } -@test_files = glob('t/*.t'); +our @test_files = glob('t/*.t'); sub isTestingFile { my ($file) = @_; @@ -40,9 +44,11 @@ sub isTestingFile { return undef; } -foreach $currentfile (@files) { +our (@testitems, @module_files); + +foreach my $currentfile (@files) { if (isTestingFile($currentfile)) { - push(@testitems,$currentfile); + push(@testitems, $currentfile); } push(@module_files, $currentfile) if $currentfile =~ /\.pm$/; } diff --git a/t/Support/Systemexec.pm b/t/Support/Systemexec.pm index 620cce25e..65be229e3 100644 --- a/t/Support/Systemexec.pm +++ b/t/Support/Systemexec.pm @@ -6,6 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Support::Systemexec; + +use 5.10.1; +use strict; +use warnings; + require Exporter; @ISA = qw(Exporter); @EXPORT = qw(system exec); diff --git a/t/Support/Templates.pm b/t/Support/Templates.pm index 2185d687f..d17c7334b 100644 --- a/t/Support/Templates.pm +++ b/t/Support/Templates.pm @@ -7,15 +7,15 @@ package Support::Templates; +use 5.10.1; use strict; +use warnings; use lib 't'; use parent qw(Exporter); -@Support::Templates::EXPORT = - qw(@languages @include_paths @english_default_include_paths - %include_path @referenced_files %actual_files $num_actual_files); -use vars qw(@languages @include_paths @english_default_include_paths - %include_path @referenced_files %actual_files $num_actual_files); +@Support::Templates::EXPORT = + qw(@languages @include_paths @english_default_include_paths + @referenced_files %actual_files $num_actual_files); use Bugzilla; use Bugzilla::Constants; @@ -25,18 +25,9 @@ use Support::Files; use File::Find; use File::Spec; -# The available template languages -@languages = (); - -# The colon separated includepath per language -%include_path = (); - -# All include paths -@include_paths = (); - # English default include paths -push @english_default_include_paths, - File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default'); +our @english_default_include_paths = + (File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default')); # And the extensions too foreach my $extension (@Support::Files::extensions) { @@ -47,19 +38,19 @@ foreach my $extension (@Support::Files::extensions) { } # Files which are referenced in the cgi files -@referenced_files = (); +our @referenced_files = (); # All files sorted by include_path -%actual_files = (); +our %actual_files = (); # total number of actual_files -$num_actual_files = 0; +our $num_actual_files = 0; # Set the template available languages and include paths -@languages = @{ Bugzilla->languages }; -@include_paths = @{ template_include_path({ language => Bugzilla->languages }) }; +our @languages = @{ Bugzilla->languages }; +our @include_paths = @{ template_include_path({ language => Bugzilla->languages }) }; -my @files; +our @files; # Local subroutine used with File::Find sub find_templates { -- cgit v1.2.3-24-g4f1b