X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F53lean_startup.t;h=525c46a2d3a0b93a99dd82967bf55fd296c302bb;hb=313510884be3d00975ae50f42af4f585eb29ae80;hp=431994005edab6afd2355a2645151b8caed06c89;hpb=4a24dba9da19a1306b30a4e8bedf157bf7dd6aa7;p=dbsrgits%2FDBIx-Class.git diff --git a/t/53lean_startup.t b/t/53lean_startup.t index 4319940..525c46a 100644 --- a/t/53lean_startup.t +++ b/t/53lean_startup.t @@ -6,6 +6,9 @@ BEGIN { # these envvars *will* bring in more stuff than the baseline delete @ENV{qw(DBICTEST_SQLT_DEPLOY DBIC_TRACE)}; + # make sure extras do not load even when this is set + $ENV{PERL_STRICTURES_EXTRA} = 1; + unshift @INC, 't/lib'; require DBICTest::Util::OverrideRequire; @@ -50,7 +53,7 @@ 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}) { + if ( $ENV{TEST_VERBOSE} or ! DBICTest::RunMode->is_plain ) { CORE::require('DBICTest/Util.pm'); Test::More::diag( 'Require invoked' . DBICTest::Util::stacktrace() ); } @@ -99,13 +102,16 @@ BEGIN { namespace::clean Try::Tiny Sub::Name + strictures + Sub::Defer + Sub::Quote Scalar::Util List::Util - Data::Compare Class::Accessor::Grouped Class::C3::Componentised + SQL::Abstract )); require DBICTest::Schema; @@ -116,7 +122,9 @@ BEGIN { { register_lazy_loadable_requires(qw( Moo - Sub::Quote + Moo::Object + Method::Generate::Accessor + Method::Generate::Constructor Context::Preserve )); @@ -129,7 +137,6 @@ BEGIN { { register_lazy_loadable_requires(qw( DBI - SQL::Abstract Hash::Merge )); @@ -152,12 +159,23 @@ BEGIN { # and do full populate() as well, just in case - shouldn't add new stuff { local $ENV{DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER}; - require DBICTest; + { + # in general we do not want DBICTest to load before sqla, but it is + # ok to cheat here + local $INC{'SQL/Abstract.pm'}; + require DBICTest; + } my $s = DBICTest->init_schema; is ($s->resultset('Artist')->find(1)->name, 'Caterwauler McCrae'); assert_no_missing_expected_requires(); } +# make sure we never loaded any of the strictures XS bullshit +{ + ok( ! exists $INC{ Module::Runtime::module_notional_filename($_) }, "$_ load never attempted" ) + for qw(indirect multidimensional bareword::filehandles); +} + done_testing; sub register_lazy_loadable_requires {