This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Suppress deprecation warnings from test output
authorJerry D. Hedden <jdhedden@cpan.org>
Thu, 3 Sep 2009 07:47:41 +0000 (09:47 +0200)
committerSteffen Mueller <smueller@cpan.org>
Thu, 3 Sep 2009 07:47:41 +0000 (09:47 +0200)
Minor modification of the original patch:
Added comments, skipped the change to Time/Local.t which has been
handled by 8ff19c00d111fa650b32e95778b91c8d7afe47f7.

lib/bigfloatpl.t
lib/bigintpl.t

index d67d13d..a3810e3 100644 (file)
@@ -5,7 +5,17 @@ BEGIN {
     @INC = '../lib';
 }
 
     @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;
 
 $test = 0;
 $| = 1;
index 569db20..9245683 100644 (file)
@@ -4,7 +4,18 @@ BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
 }
     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;
 
 $test = 0;
 $| = 1;