[libplack-test-anyevent-perl] 08/22: Suppress printing of exceptions in test suite

Jonas Smedegaard dr at jones.dk
Tue Aug 4 14:14:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libplack-test-anyevent-perl.

commit acd06995ea883c767b4ee53a6b3984019c06d5d1
Author: Rob Hoelz <rob at hoelz.ro>
Date:   Mon Jan 26 11:06:53 2015 -0600

    Suppress printing of exceptions in test suite
    
    We *know* they're coming, so why complain about them to the user?
---
 t/lib/Plack/Test/AnyEvent/Test.pm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/t/lib/Plack/Test/AnyEvent/Test.pm b/t/lib/Plack/Test/AnyEvent/Test.pm
index c2ff271..849afd4 100644
--- a/t/lib/Plack/Test/AnyEvent/Test.pm
+++ b/t/lib/Plack/Test/AnyEvent/Test.pm
@@ -21,6 +21,31 @@ sub startup :Test(startup) {
     ); # just get the ball rolling
 
     diag "Running on $AnyEvent::MODEL";
+
+    do {
+        no warnings 'once'; ## no critic (TestingAndDebugging::ProhibitNoWarnings)
+        $EV::DIED = sub {
+            unless($@ =~ /bad apple/) {
+                warn $@;
+            }
+        };
+        $Event::DIED = sub {
+            my ( undef, $error ) = @_;
+
+            unless($error =~ /bad apple/ || $error eq '?') {
+                warn $error;
+            }
+        };
+
+        eval { Glib->install_exception_handler(sub {
+            my ( $error ) = @_;
+
+            unless($error =~ /bad apple/) {
+                warn $error;
+            }
+            return 1;
+        })};
+    };
 }
 
 sub test_simple_app :Test(3) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libplack-test-anyevent-perl.git



More information about the Pkg-perl-cvs-commits mailing list