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