Skip to content

Commit

Permalink
Really make sure xt/ tests run on non-plain installs (fix c26b30d)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ribasushi committed Nov 3, 2015
1 parent 26c663f commit 554484c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 33 deletions.
20 changes: 9 additions & 11 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
3 changes: 3 additions & 0 deletions xt/dist/pod_coverage.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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} =
Expand Down
21 changes: 7 additions & 14 deletions xt/extra/lean_startup.t
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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__,
Expand Down
10 changes: 2 additions & 8 deletions xt/extra/sqlite_deadlock.t
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 554484c

Please sign in to comment.