3 use 5.008005; # older perls segfault on threading under CXSA
13 use File::Spec::Functions;
14 use File::Spec::Unix (); # need this for %INC munging
19 plan skip_all => "Sub::Name not available"
20 unless eval { require Sub::Name };
22 require Class::Accessor::Grouped;
24 my $xsa_ver = $Class::Accessor::Grouped::__minimum_xsa_version;
26 require Class::XSAccessor;
27 Class::XSAccessor->VERSION ($xsa_ver);
29 plan skip_all => "Class::XSAccessor >= $xsa_ver not available"
33 # rerun the regular 3 tests under XSAccessor
35 $Class::Accessor::Grouped::USE_XS = 1;
37 for my $tname (qw/accessors.t accessors_ro.t accessors_wo.t/) {
40 share($pass) if $has_threads;
43 note "\nTesting $tname with USE_XS (pass @{[ $pass++ ]})\n\n";
45 my ($tfn) = catfile($Bin, $tname) =~ /(.+)/;
48 qw|AccessorGroups.pm AccessorGroups/BeenThereDoneThat.pm AccessorGroupsRO.pm AccessorGroupsSubclass.pm AccessorGroupsParent.pm AccessorGroupsWO.pm|,
49 File::Spec::Unix->catfile ($tfn),
53 if (my ($mod) = $_ =~ /(.+)\.pm$/ ) {
58 local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /subroutine .+ redefined/i };
70 # nested threading of this sort badly blows up on 5.10.0 (fixed with 5.10.1)
71 unless ($] > 5.009 and $] < 5.010001) {
80 'Innner thread joined ok',
83 is ($todo->(), 666, "Intermediate result ok");
91 'Outer thread joined ok',
94 is ($todo->(), 666, "Unthreaded run ok") for (1,2);
98 is ($todo->(), 666, "Unthreaded run ok") for (1,2);