Commit | Line | Data |
79061be1 |
1 | use warnings; |
2 | use strict; |
3 | |
4 | use Test::More; |
5 | use File::Find; |
6 | |
052a832c |
7 | use DBIx::Class::_Util 'sigwarn_silencer'; |
8 | |
79061be1 |
9 | use lib 't/lib'; |
c5ffac15 |
10 | use lib 't/dqlib'; |
79061be1 |
11 | |
12 | find({ |
13 | wanted => sub { |
14 | |
15 | return unless ( -f $_ and $_ =~ /\.pm$/ ); |
16 | |
17 | my $pid = fork(); |
18 | if (! defined $pid) { |
19 | die "fork failed: $!" |
20 | } |
21 | elsif (!$pid) { |
052a832c |
22 | if (my @offenders = grep { $_ ne 'DBIx/Class/_Util.pm' } grep { $_ =~ /(^|\/)DBI/ } keys %INC) { |
79061be1 |
23 | die "Wtf - DBI* modules present in %INC: @offenders"; |
24 | } |
25 | |
052a832c |
26 | local $SIG{__WARN__} = sigwarn_silencer( qr/\bdeprecated\b/i ); |
562a1229 |
27 | require( ( $_ =~ m| t/lib/ (.+) |x )[0] ); # untaint and strip lib-part (. is unavailable under -T) |
79061be1 |
28 | exit 0; |
29 | } |
30 | |
31 | is ( waitpid($pid, 0), $pid, "Fork $pid terminated sucessfully"); |
32 | my $ex = $? >> 8; |
33 | is ( $ex, 0, "Loading $_ ($pid) exitted with $ex" ); |
34 | }, |
35 | |
36 | no_chdir => 1, |
37 | }, 't/lib/DBICTest/Schema/'); |
38 | |
39 | done_testing; |