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