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