[perl-Gtk3] Fix test failures on unthreaded perls on FreeBSD



commit 3d34074f87f560657a947bc7929d2513fd2cd787
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sat Nov 29 18:24:57 2014 +0100

    Fix test failures on unthreaded perls on FreeBSD

 t/inc/setup.pl                |   10 ++++++++++
 t/overrides.t                 |    5 ++++-
 t/zz-GtkRecentChooserDialog.t |    6 +++++-
 3 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/t/inc/setup.pl b/t/inc/setup.pl
index aac3750..2927363 100644
--- a/t/inc/setup.pl
+++ b/t/inc/setup.pl
@@ -10,4 +10,14 @@ sub check_gi_version {
   return !system ('pkg-config', "--atleast-version=$x.$y.$z", 'gobject-introspection-1.0');
 }
 
+sub on_unthreaded_freebsd {
+  if ($^O eq 'freebsd') {
+    require Config;
+    if ($Config::Config{ldflags} !~ m/-pthread\b/) {
+      return 1;
+    }
+  }
+  return 0;
+}
+
 1;
diff --git a/t/overrides.t b/t/overrides.t
index 25348f4..4caa369 100644
--- a/t/overrides.t
+++ b/t/overrides.t
@@ -159,7 +159,10 @@ SKIP: {
 }
 
 note('Gtk3::FileChooserDialog');
-{
+SKIP: {
+  skip 'need a perl built with "-pthread" on freebsd', 3
+    if on_unthreaded_freebsd ();
+
   my $parent = Gtk3::Window->new;
   my $dialog = Gtk3::FileChooserDialog->new ('some title', $parent, 'save',
                                              'gtk-cancel' => 'cancel',
diff --git a/t/zz-GtkRecentChooserDialog.t b/t/zz-GtkRecentChooserDialog.t
index debac8a..7365042 100644
--- a/t/zz-GtkRecentChooserDialog.t
+++ b/t/zz-GtkRecentChooserDialog.t
@@ -8,7 +8,11 @@ BEGIN { require './t/inc/setup.pl' }
 use strict;
 use warnings;
 
-plan tests => 12;
+if (on_unthreaded_freebsd ()) {
+  plan skip_all => 'need a perl built with "-pthread" on freebsd';
+} else {
+  plan tests => 12;
+}
 
 my $window = Gtk3::Window->new;
 my $manager = Gtk3::RecentManager->new;


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