Koha/xt/check_makefile.t
Jonathan Druart 5c73ac5c23 Bug 34911: Test files from HEAD instead of 'master'
Since bug 34303 the test suite (when ran on jenkins) is no longer testing Perl::Critic

koha_1       | fatal: Not a valid object name master
koha_1       | [14:58:14] t/00-testcritic.t

We are not cloning the whole repo and "master" is not available. Additionally we do not want to test master's files on stable branches anyway...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7dd57db429)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-10-05 09:38:43 -10:00

39 lines
1.2 KiB
Perl
Executable file

#!/usr/bin/perl
# Copyright 2020 Koha Development Team
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use Test::More;
plan tests => 1;
use File::Spec;
use File::Slurp qw( read_file );
use Data::Dumper;
my $curdir = File::Spec->curdir();
my @dirs = `git ls-tree -d --name-only HEAD`;
my $makefile = read_file("$curdir/Makefile.PL");
my @missing;
for my $d ( sort @dirs ) {
chomp $d;
next if $d =~ /^debian$/;
next if $makefile =~ m{'\./$d('|\/)}xms;
push @missing, $d;
}
is( scalar @missing, 0, 'All directories must be listed in Makefile.PL' ) or diag Dumper \@missing;