X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F30-threads.t;h=690bd1167658ba44bab73296acbbeb628ef1a0f4;hb=df2d2239c4e52ed9bf6891f03d6a3bb8e65a1297;hp=2bec94f8139789f0cb9f5e09490642a7f156ea8f;hpb=86fd49234c91a91300d95ba292129a1825d396ab;p=perl%2Fmodules%2FLinux-SysInfo.git diff --git a/t/30-threads.t b/t/30-threads.t index 2bec94f..690bd11 100644 --- a/t/30-threads.t +++ b/t/30-threads.t @@ -3,21 +3,24 @@ use strict; use warnings; -use Config qw/%Config/; +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/; +use Linux::SysInfo qw; sub try { my $tid = threads->tid();