Bug 40315: Remove warnings from xt/tt_tidy.t

Maybe we could remove the warnings from misc/devel/tidy.pl if the file
was originally empty but for now it feels safer to skip the tidy of
empty files

Test plan:
  prove xt/tt_tidy.t xt/use-test-no-warnings.t
should return green

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-07-18 14:43:00 +02:00 committed by Lucas Gass
parent 582f673faa
commit a43065d307
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 12 additions and 8 deletions

View File

@ -19,6 +19,7 @@ use Modern::Perl;
use threads; # used for parallel
use File::Slurp qw( read_file );
use Test::More;
use Test::NoWarnings;
use Test::Strict;
use Parallel::ForkManager;
use Sys::CPU;
@ -39,16 +40,22 @@ if ( $ENV{KOHA_PROVE_CPUS} ) {
my $pm = Parallel::ForkManager->new($ncpu);
plan tests => scalar(@tt_files) + 1;
foreach my $filepath (@tt_files) {
$pm->start and next;
my $tidy = qx{perl misc/devel/tidy.pl --silent --no-write $filepath};
my $content = read_file $filepath;
ok( $content eq $tidy, "$filepath should be kept tidy" );
if ( !-s $filepath ) {
# Do not tidy empty files
ok(1);
} else {
my $tidy = qx{perl misc/devel/tidy.pl --silent --no-write $filepath};
my $content = read_file $filepath;
ok( $content eq $tidy, "$filepath should be kept tidy" );
}
$pm->finish;
}
$pm->wait_all_children;
done_testing;

View File

@ -46,9 +46,6 @@ my @exceptions = (
# bug 40449
"xt/author/valid-templates.t",
# bug 40315
"xt/tt_tidy.t",
);
@t_files = array_minus( @t_files, @exceptions );