[perl-Glib/freebsd-child-watch-fix] Fix hang of t/9.t on FreeBSD perl's not built with "-pthread"



commit 9e3d2adb9541f98063b9d10c93232282910e9af6
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Sat Nov 1 17:34:58 2014 +0100

    Fix hang of t/9.t on FreeBSD perl's not built with "-pthread"
    
    Glib's child watches will not work when perl was not linked against
    libpthread/libthr.
    
    https://rt.cpan.org/Ticket/Display.html?id=82349

 t/9.t |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/t/9.t b/t/9.t
index d067434..21c3f60 100644
--- a/t/9.t
+++ b/t/9.t
@@ -210,16 +210,18 @@ if (Glib->CHECK_VERSION (2, 14, 0)) {
 
 
 {
+  my $skip_reason = undef;
   if (! $have_fork) {
-    print "ok 26 # skip, no fork: $fork_excuse\n";
-    print "ok 27 # skip\n";
-    print "ok 28 # skip\n";
-    print "ok 29 # skip\n";
-    print "ok 30 # skip\n";
-    goto SKIP_CHILD_TESTS;
+    $skip_reason = "no fork: $fork_excuse";
   }
   if (! Glib->CHECK_VERSION (2, 4, 0)) {
-    print "ok 26 # skip: need glib >= 2.4\n";
+    $skip_reason = 'need glib >= 2.4';
+  }
+  if ($^O eq 'freebsd' && $Config{ldflags} !~ m/-pthread\b/) {
+    $skip_reason = 'need a perl built with "-pthread" on freebsd';
+  }
+  if (defined $skip_reason) {
+    print "ok 26 # skip: $skip_reason\n";
     print "ok 27 # skip\n";
     print "ok 28 # skip\n";
     print "ok 29 # skip\n";


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