X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F30-threads.t;h=cd4c3a617861242968c7e82bce6866e93c81720f;hb=HEAD;hp=2bec94f8139789f0cb9f5e09490642a7f156ea8f;hpb=86fd49234c91a91300d95ba292129a1825d396ab;p=perl%2Fmodules%2FLinux-SysInfo.git diff --git a/t/30-threads.t b/t/30-threads.t index 2bec94f..cd4c3a6 100644 --- a/t/30-threads.t +++ b/t/30-threads.t @@ -3,21 +3,12 @@ use strict; use warnings; -use Config qw/%Config/; +use lib 't/lib'; +use Linux::SysInfo::TestThreads; -BEGIN { - if (!$Config{useithreads}) { - require Test::More; - Test::More->import; - plan(skip_all => 'This perl wasn\'t built to support threads'); - } -} - -use threads; +use Test::More 'no_plan'; -use Test::More tests => 4 * 10; - -use Linux::SysInfo qw/sysinfo/; +use Linux::SysInfo qw; sub try { my $tid = threads->tid(); @@ -37,5 +28,8 @@ sub try { } } -my @t = map { threads->create(\&try, $_) } 1 .. 10; -$_->join for @t; +my @threads = map spawn(\&try, $_), 1 .. 10; + +$_->join for @threads; + +pass 'done';