THROW AWAY this commit on rebase - dirty bootstrap
[dbsrgits/DBIx-Class.git] / t / 02_standalone_test_classes.t
1 use warnings;
2 use strict;
3
4 use Test::More;
5 use File::Find;
6
7 use lib 't/lib';
8 use lib 't/dqlib';
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 };
25       require( ( $_ =~ m| t/lib/ (.+) |x )[0] ); # untaint and strip lib-part (. is unavailable under -T)
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;