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