From: Peter Rabbitson Date: Tue, 3 Nov 2015 14:32:08 +0000 (+0100) Subject: Really make sure xt/ tests run on non-plain installs (fix c26b30de) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=554484cbb19aadbcb23e28dfbd3de048518ece0d;p=dbsrgits%2FDBIx-Class.git Really make sure xt/ tests run on non-plain installs (fix c26b30de) FACEDESK: Module::Install::Makefile::tests_recursive() takes a single arg and throws the rest away... I mean what the flying... Also remove some of the "is this plain user" checks from within xt/ Read under -w --- diff --git a/Makefile.PL b/Makefile.PL index 5f931f1..a7f87ed 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -117,17 +117,15 @@ if ( my @optdeps = ( } } -tests_recursive ( - 't', - ( ( - $Module::Install::AUTHOR - or - $ENV{DBICTEST_RUN_ALL_TESTS} - or - ( $ENV{TRAVIS}||'' ) eq 'true' - or - ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL5_CPANM_IS_RUNNING} and ! $ENV{RELEASE_TESTING} ) - ) ? 'xt' : () ), +tests_recursive ('t'); +tests_recursive ('xt') if ( + $Module::Install::AUTHOR + or + $ENV{DBICTEST_RUN_ALL_TESTS} + or + ( $ENV{TRAVIS}||'' ) eq 'true' + or + ( $ENV{AUTOMATED_TESTING} and ! $ENV{PERL5_CPANM_IS_RUNNING} and ! $ENV{RELEASE_TESTING} ) ); install_script (qw| diff --git a/xt/dist/pod_coverage.t b/xt/dist/pod_coverage.t index 88bcb81..1f3195a 100644 --- a/xt/dist/pod_coverage.t +++ b/xt/dist/pod_coverage.t @@ -5,6 +5,7 @@ use strict; use Test::More; use List::Util 'first'; +use Module::Runtime 'require_module'; use lib qw(t/lib maint/.Generated_Pod/lib); use DBICTest; use namespace::clean; @@ -172,6 +173,8 @@ foreach my $module (@modules) { skip ("$module exempt", 1) if ($ex->{skip}); + skip ("$module not loadable", 1) unless eval { require_module($module) }; + # build parms up from ignore list my $parms = {}; $parms->{trustme} = diff --git a/xt/extra/lean_startup.t b/xt/extra/lean_startup.t index 95bec73..8c220dd 100644 --- a/xt/extra/lean_startup.t +++ b/xt/extra/lean_startup.t @@ -53,10 +53,8 @@ BEGIN { CORE::require('Test/More.pm'); Test::More::fail ("Unexpected require of '$req' by $caller[0] ($caller[1] line $caller[2])"); - if ( $ENV{TEST_VERBOSE} or ! DBICTest::RunMode->is_plain ) { - CORE::require('DBICTest/Util.pm'); - Test::More::diag( 'Require invoked' . DBICTest::Util::stacktrace() ); - } + CORE::require('DBICTest/Util.pm'); + Test::More::diag( 'Require invoked' . DBICTest::Util::stacktrace() ); } return $res; @@ -199,16 +197,11 @@ sub assert_no_missing_expected_requires { my $nl; for my $mod (keys %$expected_dbic_deps) { (my $modfn = "$mod.pm") =~ s/::/\//g; - unless ($INC{$modfn}) { - my $err = sprintf "Expected DBIC core dependency '%s' never loaded - %s needs adjustment", $mod, __FILE__; - if (DBICTest::RunMode->is_smoker or DBICTest::RunMode->is_author) { - fail ($err) - } - else { - diag "\n" unless $nl->{$mod}++; - diag $err; - } - } + fail sprintf ( + "Expected DBIC core dependency '%s' never loaded - %s needs adjustment", + $mod, + __FILE__ + ) unless $INC{$modfn}; } pass(sprintf 'All modules expected at %s line %s loaded by DBIC: %s', __FILE__, diff --git a/xt/extra/sqlite_deadlock.t b/xt/extra/sqlite_deadlock.t index b0e8f3b..a9fdca9 100644 --- a/xt/extra/sqlite_deadlock.t +++ b/xt/extra/sqlite_deadlock.t @@ -2,17 +2,11 @@ use strict; use warnings; use Test::More; +use Test::Exception; +use File::Temp (); use lib 't/lib'; -BEGIN { - require DBICTest::RunMode; - plan( skip_all => "Skipping test on plain module install" ) - if DBICTest::RunMode->is_plain; -} - -use Test::Exception; use DBICTest; -use File::Temp (); plan tests => 2; my $wait_for = 120; # how many seconds to wait