From: Peter Rabbitson Date: Tue, 3 Nov 2015 14:32:08 +0000 (+0100) Subject: Run xt/ tests on non-plain installs X-Git-Tag: v0.082840~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2b2c98ddfb671dfbe7fe59cc5071a71020cfbb4c;p=dbsrgits%2FDBIx-Class.git Run xt/ tests on non-plain installs ( cherry-pick of c26b30de and 554484cb ) FACEDESK: Module::Install::Makefile::tests_recursive() takes a single arg and throws the rest away... I mean what the flying... --- diff --git a/Makefile.PL b/Makefile.PL index 409ec2b..044b069 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -115,9 +115,20 @@ if ($ENV{DBICTEST_SQLT_DEPLOY}) { } } -tests_recursive (qw| - t -|); +tests_recursive ('t'); +tests_recursive ('xt') if ( + $Module::Install::AUTHOR + or + $ENV{DBICTEST_RUN_ALL_TESTS} + or + ( + ( $ENV{TRAVIS}||'' ) eq 'true' + and + ($ENV{TRAVIS_REPO_SLUG}||'') =~ m|\w+/dbix-class$| + ) + or + ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL5_CPANM_IS_RUNNING} and ! $ENV{RELEASE_TESTING} ) +); install_script (qw| script/dbicadmin diff --git a/t/lib/DBICTest/Util/LeakTracer.pm b/t/lib/DBICTest/Util/LeakTracer.pm index b81932c..b3d28a3 100644 --- a/t/lib/DBICTest/Util/LeakTracer.pm +++ b/t/lib/DBICTest/Util/LeakTracer.pm @@ -343,10 +343,11 @@ END { or DBICTest::RunMode->is_plain ) { - for (qw(indirect multidimensional bareword::filehandles)) { - exists $INC{ Module::Runtime::module_notional_filename($_) } - and - $tb->ok(0, "$_ load should not have been attempted!!!" ) + for my $mod (qw(indirect multidimensional bareword::filehandles)) { + ( my $fn = "$mod.pm" ) =~ s|::|/|g; + + $tb->ok(0, "Load of '$mod' should not have been attempted!!!" ) + if exists $INC{$fn}; } } } diff --git a/xt/podcoverage.t b/xt/podcoverage.t index 3ef6f56..f5633e0 100644 --- a/xt/podcoverage.t +++ b/xt/podcoverage.t @@ -116,6 +116,7 @@ my $exceptions = { }, 'DBIx::Class::Admin::*' => { skip => 1 }, + 'DBIx::Class::Optional::Dependencies' => { skip => 1 }, 'DBIx::Class::ClassResolver::PassThrough' => { skip => 1 }, 'DBIx::Class::Componentised' => { skip => 1 }, 'DBIx::Class::AccessorGroup' => { skip => 1 }, @@ -174,6 +175,8 @@ foreach my $module (@modules) { skip ("$module exempt", 1) if ($ex->{skip}); + skip ("$module not loadable", 1) unless eval "require $module"; + # build parms up from ignore list my $parms = {}; $parms->{trustme} =