[perl-Gtk3] Attempt to reduce false negatives from CPAN testers



commit e1a6b0875a5cd2d8b506d2cca3e82e61c59cd9f7
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sun Sep 21 13:50:07 2014 +0200

    Attempt to reduce false negatives from CPAN testers
    
    Include the string "OS unsupported" in the error output from the test suite
    when the Gtk3 typelib cannot be loaded.

 t/00-init.t |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/t/00-init.t b/t/00-init.t
index 2afd03b..c39bc7d 100644
--- a/t/00-init.t
+++ b/t/00-init.t
@@ -6,9 +6,16 @@ use warnings;
 use Test::More;
 
 BEGIN { require Gtk3; }
-my $success = eval { Gtk3->import; 1 };
-BAIL_OUT ("Cannot load Gtk3: $@")
-  unless $success;
+unless (eval { Gtk3->import; 1 }) {
+  my $error = $@;
+  if (eval { $error->isa ('Glib::Error') &&
+             $error->domain eq 'g-irepository-error-quark'})
+  {
+    BAIL_OUT ("OS unsupported: $error");
+  } else {
+    BAIL_OUT ("Cannot load Gtk3: $error");
+  }
+}
 
 plan tests => 2;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]