From d33f716562df3d19dac4bfe811713f6c1f684bae Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Fri, 1 May 2015 14:29:13 -0400 Subject: [PATCH] Bug 14110: Silence t/00-load.t warnings prove t/00-load.t has noisy messages. This catches them. TEST PLAN --------- 1) $ prove -v t/00-load.t -- ugly INIT errors, etc. 2) apply patch 3) $ prove -v t/00-load.t -- nice "Expected warnings" type messages on the ones that were noisy. 4) koha qa test tools --- t/00-load.t | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/t/00-load.t b/t/00-load.t index 21b62eb..d909567 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -17,7 +17,9 @@ use Modern::Perl; +$| = 1; use Test::More; +use Test::Warn; use File::Spec; use File::Find; @@ -42,9 +44,29 @@ find({ $m =~ s{^.*/C4/}{C4/}; $m =~ s{/}{::}g; - return if $m =~ /Auth_with_ldap/; # Dont test this, it will fail on use - return if $m =~ /SIPServer/; # SIP Server module has old package usage - use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'"); + if ($m eq "C4::External::BakerTaylor") { + warning_like { eval "use $m; 1;" } +qr/Too late to run INIT block at .*C4\/External\/BakerTaylor.pm line 42/i, + "use $m; -- Expected warnings"; + } + elsif ($m eq "C4::SIP::SIPServer") { + warning_like { eval "use $m; 1;" } +qr/UNIVERSAL->import is deprecated and will be removed in a future perl/i, + "use $m; -- Expected warnings"; + } + elsif ($m eq "C4::Barcodes") { + warning_like { eval "use $m; 1;" } +qr/Too late to run INIT block at .*C4\/Barcodes\/hbyymmincr.pm line 41/i, + "use $m; -- Expected warnings"; + } + elsif ($m eq "C4::Tags") { + warning_like { eval "use $m; 1;" } +qr/Too late to run INIT block at .*C4\/Tags.pm line 75/i, + "use $m; -- Expected warnings"; + } + else { + warning_is { eval "use $m; 1;" } '',"use $m;"; + } }, }, $lib); -- 2.1.4