From: Vincent Pit Date: Fri, 5 Mar 2010 22:42:13 +0000 (+0100) Subject: Fix the logic for skipping t/30-threads.t on perls with ithreads but without threads.pm X-Git-Tag: v0.13~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=9212eb38043ca8ba14329a510fc6f9673020b0fe;p=perl%2Fmodules%2FLinux-SysInfo.git Fix the logic for skipping t/30-threads.t on perls with ithreads but without threads.pm --- diff --git a/t/30-threads.t b/t/30-threads.t index 2bec94f..b7318c7 100644 --- a/t/30-threads.t +++ b/t/30-threads.t @@ -6,17 +6,20 @@ use warnings; use Config qw/%Config/; BEGIN { - if (!$Config{useithreads}) { - require Test::More; - Test::More->import; + my $has_threads = do { + local $@; + $Config{useithreads} and eval "use threads; 1"; + }; + # Load Test::More after threads + require Test::More; + Test::More->import; + if ($has_threads) { + plan(tests => 4 * 10); + } else { plan(skip_all => 'This perl wasn\'t built to support threads'); } } -use threads; - -use Test::More tests => 4 * 10; - use Linux::SysInfo qw/sysinfo/; sub try {