X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F53lean_startup.t;h=b6c8be9d4d9eae0f92448a0f94122adaf6cb00a8;hb=cf9ba393c6309a66fe31b2decb7574fdf068a759;hp=de46c8c18075abf801971e1e824b837aa227e4cd;hpb=fb88ca2c952ef2e17f6e8a414079f12f71761ff7;p=dbsrgits%2FDBIx-Class.git diff --git a/t/53lean_startup.t b/t/53lean_startup.t index de46c8c..b6c8be9 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,19 @@ 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 + + Module::Runtime + File::Spec )); require DBICTest::Schema; @@ -116,7 +125,9 @@ BEGIN { { register_lazy_loadable_requires(qw( Moo - Sub::Quote + Moo::Object + Method::Generate::Accessor + Method::Generate::Constructor Context::Preserve )); @@ -129,7 +140,6 @@ BEGIN { { register_lazy_loadable_requires(qw( DBI - SQL::Abstract Hash::Merge )); @@ -151,12 +161,24 @@ BEGIN { # and do full populate() as well, just in case - shouldn't add new stuff { - require DBICTest; + local $ENV{DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER}; + { + # 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 {