Make sure DBICTest is always loaded first (purely bookkeep)
[dbsrgits/DBIx-Class.git] / xt / standalone_testschema_resultclasses.t
1 use warnings;
2 use strict;
3
4 use Test::More;
5 use File::Find;
6
7 use DBIx::Class::_Util 'sigwarn_silencer';
8
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) {
21       if (my @offenders = grep { $_ ne 'DBIx/Class/_Util.pm' } grep { $_ =~ /(^|\/)DBI/ } keys %INC) {
22         die "Wtf - DBI* modules present in %INC: @offenders";
23       }
24
25       local $SIG{__WARN__} = sigwarn_silencer( qr/\bdeprecated\b/i );
26       require( ( $_ =~ m| t/lib/ (.+) |x )[0] ); # untaint and strip lib-part (. is unavailable under -T)
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;