This is an expensive author-only test, move to xt/
Also get xt tests first in line (won't matter much with -s)
Peter Rabbitson
10 years ago
11 | 11 |
my @xt_tests = map { File::Spec->catfile($_, '*.t') } sort keys %$xt_dirs;
|
12 | 12 |
|
13 | 13 |
# this will add the xt tests to the `make test` target among other things
|
14 | |
Meta->tests(join (' ', map { $_ || () } Meta->tests, @xt_tests ) );
|
|
14 |
Meta->tests(join (' ', map { $_ || () } @xt_tests, Meta->tests ) );
|
15 | 15 |
|
16 | 16 |
# inject an explicit xt test run, mainly to check the contents of
|
17 | 17 |
# lib and the generated POD's *before* anything is copied around
|
13 | 13 |
run_or_err "Prepare blib" "make pure_all"
|
14 | 14 |
run_harness_tests
|
15 | 15 |
else
|
16 | |
PROVECMD="prove -lrswj$NUMTHREADS t xt"
|
|
16 |
PROVECMD="prove -lrswj$NUMTHREADS xt t"
|
17 | 17 |
|
18 | 18 |
# FIXME - temporary, until Package::Stash is fixed
|
19 | 19 |
if perl -M5.010 -e 1 &>/dev/null ; then
|
t/02_standalone_test_classes.t
less
more
0 | |
use warnings;
|
1 | |
use strict;
|
2 | |
|
3 | |
use Test::More;
|
4 | |
use File::Find;
|
5 | |
|
6 | |
use DBIx::Class::_Util 'sigwarn_silencer';
|
7 | |
|
8 | |
use lib 't/lib';
|
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 { $_ ne 'DBIx/Class/_Util.pm' } grep { $_ =~ /(^|\/)DBI/ } keys %INC) {
|
21 | |
die "Wtf - DBI* modules present in %INC: @offenders";
|
22 | |
}
|
23 | |
|
24 | |
local $SIG{__WARN__} = sigwarn_silencer( qr/\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;
|
|
0 |
use warnings;
|
|
1 |
use strict;
|
|
2 |
|
|
3 |
use Test::More;
|
|
4 |
use File::Find;
|
|
5 |
|
|
6 |
use DBIx::Class::_Util 'sigwarn_silencer';
|
|
7 |
|
|
8 |
use lib 't/lib';
|
|
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 { $_ ne 'DBIx/Class/_Util.pm' } grep { $_ =~ /(^|\/)DBI/ } keys %INC) {
|
|
21 |
die "Wtf - DBI* modules present in %INC: @offenders";
|
|
22 |
}
|
|
23 |
|
|
24 |
local $SIG{__WARN__} = sigwarn_silencer( qr/\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;
|