develooper Front page | perl.perl5.porters | Postings from April 2003

Re: 5.8.1@19053 bug: make minitest fails with threads

Thread Previous
From:
Rafael Garcia-Suarez
Date:
April 1, 2003 01:02
Subject:
Re: 5.8.1@19053 bug: make minitest fails with threads
Message ID:
20030401110235.3f20ffb2.rgarciasuarez@free.fr
Ilya Zakharevich wrote:
> make minitest should not use any XS-based module.  But t/op/getpid.t does.
> 
> This leads to a failure of 'make minitest' on a threaded perl.

I'm guilty for that.
The patch below tries to bring more robustness to this test :

Index: t/op/getpid.t
===================================================================
--- t/op/getpid.t	(revision 1050)
+++ t/op/getpid.t	(working copy)
@@ -11,8 +11,6 @@
 use strict;
 use Config;
 
-plan tests => 2;
-
 BEGIN {
     if (!$Config{useithreads}) {
 	print "1..0 # Skip: no ithreads\n";
@@ -22,10 +20,19 @@
 	print "1..0 # Skip: no getppid\n";
 	exit;
     }
+    eval 'use threads; use threads::shared';
+    if ($@ =~ /dynamic loading not available/) {
+	print "1..0 # Skip: no dynamic loading, no threads\n";
+	exit;
+    }
+    plan tests => 3;
+    if ($@) {
+	fail("unable to load thread modules");
+    }
+    else {
+	pass("thread modules loaded");
+    }
 }
-
-use threads;
-use threads::shared;
 
 my ($pid, $ppid) = ($$, getppid());
 my $pid2 : shared = 0;
End of Patch.

-- 
Unconstrained is not *NIX

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About