6 BEGIN { delete $ENV{PERL_TEST_LEANER_USES_TEST_MORE} }
11 Test::Leaner::plan(skip_all => $msg);
14 use Config qw/%Config/;
17 my $force = $ENV{PERL_TEST_LEANER_TEST_THREADS} ? 1 : !1;
18 my $t_v = $force ? '0' : '1.67';
19 skipall 'This perl wasn\'t built to support threads'
20 unless $Config{useithreads};
21 skipall 'perl 5.13.4 required to test thread safety'
22 unless $force or "$]" >= 5.013004;
23 skipall "threads $t_v required to test thread safety"
24 unless eval "use threads $t_v; 1";
27 use Test::Leaner; # after threads
30 skipall 'This Test::Leaner isn\'t thread safe' unless Test::Leaner::THREADSAFE;
32 defined and diag "Using threads $_" for $threads::VERSION;
36 sleep 1 if rand() < 0.5;
40 my $tid = threads->tid;
41 diag "spawned thread $tid";
44 cmp_ok 1, '==', '1.0', "test $_ in thread $tid";
49 $_->join for map threads->create(\&worker), 1 .. 8;