4 use DBIx::Class::_Util 'sigwarn_silencer';
5 use if DBIx::Class::_ENV_::BROKEN_FORK, 'threads';
9 use Time::HiRes 'sleep';
17 if (my @offenders = grep { $_ ne 'DBIx/Class/_Util.pm' } grep { $_ =~ /(^|\/)DBI/ } keys %INC) {
18 die "Wtf - DBI* modules present in %INC: @offenders";
21 local $SIG{__WARN__} = sigwarn_silencer( qr/\bdeprecated\b/i );
22 require( ( $fn =~ m| t/lib/ (.+) |x )[0] ); # untaint and strip lib-part (. is unavailable under -T)
31 return unless ( -f $_ and $_ =~ /\.pm$/ );
33 if (DBIx::Class::_ENV_::BROKEN_FORK) {
34 # older perls crash if threads are spawned way too quickly, sleep for 100 msecs
35 my $t = threads->create(sub { $worker->($_) });
37 is ($t->join, 42, "Thread loading $_ did not finish successfully")
38 || diag ($t->can('error') ? $t->error : 'threads.pm too old to retrieve the error :(' );
50 is ( waitpid($pid, 0), $pid, "Fork $pid terminated sucessfully");
52 is ( $ex, 0, "Loading $_ ($pid) exitted with $ex" );
57 }, 't/lib/DBICTest/Schema/');