1use strict; 2use warnings; 3 4use Test2::Util qw/CAN_THREAD/; 5BEGIN { 6 unless(CAN_THREAD) { 7 require Test::More; 8 Test::More->import(skip_all => "threads are not supported"); 9 } 10} 11 12use threads; 13use Test::More; 14 15my $t = threads->create( 16 sub { 17 local $TODO = "Some good reason"; 18 19 fail "Crap"; 20 21 42; 22 } 23); 24 25is( 26 $t->join, 27 42, 28 "Thread exited successfully" 29); 30 31done_testing; 32