From: Jerry D. Hedden Date: Thu, 3 Sep 2009 07:47:41 +0000 (+0200) Subject: Suppress deprecation warnings from test output X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96471c6b3e9cad6e88559f66a5fdf6902c5e7b4a;p=p5sagit%2Fp5-mst-13.2.git Suppress deprecation warnings from test output Minor modification of the original patch: Added comments, skipped the change to Time/Local.t which has been handled by 8ff19c00d111fa650b32e95778b91c8d7afe47f7. --- diff --git a/lib/bigfloatpl.t b/lib/bigfloatpl.t index d67d13d..a3810e3 100644 --- a/lib/bigfloatpl.t +++ b/lib/bigfloatpl.t @@ -5,7 +5,17 @@ BEGIN { @INC = '../lib'; } -require "bigfloat.pl"; +{ + # Silence the deprecation warnings from bigfloat.pl for the purpose + # of testing. These tests will be removed along with bigfloat.pl in + # the next major release of perl. + local $SIG{__WARN__} = sub { + if ($_[0] !~ /deprecated/) { + print(STDERR @_); + } + }; + require "bigfloat.pl"; +} $test = 0; $| = 1; diff --git a/lib/bigintpl.t b/lib/bigintpl.t index 569db20..9245683 100644 --- a/lib/bigintpl.t +++ b/lib/bigintpl.t @@ -4,7 +4,18 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; } -require "bigint.pl"; + +{ + # Silence the deprecation warnings from bigint.pl for the purpose + # of testing. These tests will be removed along with bigint.pl in + # the next major release of perl. + local $SIG{__WARN__} = sub { + if ($_[0] !~ /deprecated/) { + print(STDERR @_); + } + }; + require "bigint.pl"; +} $test = 0; $| = 1;