From e6bf4cacb10f86077fe898349485f5c7ab9fb4b6 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 30 Jun 2016 23:32:40 -0400 Subject: Bug 1283930 - Add Makefile.PL & local/lib/perl5 support to bmo/master + local symlink to data/ directory --- t/Support/Files.pm | 61 ++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 32 deletions(-) (limited to 't/Support/Files.pm') diff --git a/t/Support/Files.pm b/t/Support/Files.pm index 00e0efd34..1bdf2eac7 100644 --- a/t/Support/Files.pm +++ b/t/Support/Files.pm @@ -1,45 +1,40 @@ -# -*- Mode: perl; indent-tabs-mode: nil -*- -# -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. -# -# The Original Code are the Bugzilla Tests. -# -# The Initial Developer of the Original Code is Zach Lipton -# Portions created by Zach Lipton are -# Copyright (C) 2001 Zach Lipton. All -# Rights Reserved. -# -# Contributor(s): Zach Lipton -# Joel Peshkin +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. package Support::Files; -use Bugzilla; +use 5.10.1; +use strict; +use warnings; use File::Find; +our @additional_files = (); + use constant IGNORE => qw( Bugzilla/DuoAPI.pm Bugzilla/DuoWeb.pm ); -@additional_files = (); +our @files = glob('*'); +find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, qw(Bugzilla docs)); +push(@files, 'extensions/create.pl', 'docs/makedocs.pl', 'cpanfile'); + +our @extensions = + grep { $_ ne 'extensions/create.pl' && ! -e "$_/disabled" } + glob('extensions/*'); + +foreach my $extension (@extensions) { + find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, $extension); +} -@files = glob('*'); -my @extension_paths = map { $_->package_dir } @{ Bugzilla->extensions }; -find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'Bugzilla', @extension_paths); -push(@files, 'extensions/create.pl'); +our @test_files = glob('t/*.t xt/*/*.t'); -my @extensions = glob('extensions/*'); foreach my $extension (@extensions) { # Skip disabled extensions next if -e "$extension/disabled"; @@ -55,7 +50,7 @@ sub isTestingFile { return undef if $ignore eq $file; } - if ($file =~ /\.cgi$|\.pl$|\.pm$/) { + if ($file =~ /\.psgi$|\.cgi$|\.pl$|\.pm$/) { return 1; } my $additional; @@ -65,11 +60,13 @@ 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$/; } - 1; -- cgit v1.2.3-24-g4f1b