use warnings;
use strict;
+use DBIx::Class::Exception;
+use DBIx::Class::Carp;
+use Context::Preserve 'preserve_context';
+use DBIx::Class::_Util qw(is_exception qsub);
+use Scalar::Util qw(weaken blessed reftype);
+use Try::Tiny;
+
# DO NOT edit away without talking to riba first, he will just put it back
# BEGIN pre-Moo2 import block
BEGIN {
my $initial_fatal_bits = (${^WARNING_BITS}||'') & $warnings::DeadBits{all};
+
local $ENV{PERL_STRICTURES_EXTRA} = 0;
- require Moo; Moo->import;
+ # load all of these now, so that lazy-loading does not escape
+ # the current PERL_STRICTURES_EXTRA setting
+ require Sub::Quote;
+ require Sub::Defer;
+ require Moo;
+ require Moo::Object;
+ require Method::Generate::Accessor;
+ require Method::Generate::Constructor;
+
+ Moo->import;
${^WARNING_BITS} &= ( $initial_fatal_bits | ~ $warnings::DeadBits{all} );
}
# END pre-Moo2 import block
-use DBIx::Class::Exception;
-use DBIx::Class::Carp;
-use Context::Preserve 'preserve_context';
-use DBIx::Class::_Util qw(is_exception qsub);
-use Scalar::Util qw(weaken blessed reftype);
-use Try::Tiny;
-
use namespace::clean;
=head1 NAME
use strict;
use warnings;
+use DBIx::Class::_Util qw(sigwarn_silencer qsub);
+
# DO NOT edit away without talking to riba first, he will just put it back
# BEGIN pre-Moo2 import block
BEGIN {
my $initial_fatal_bits = (${^WARNING_BITS}||'') & $warnings::DeadBits{all};
+
local $ENV{PERL_STRICTURES_EXTRA} = 0;
- require Moo; Moo->import;
+ # load all of these now, so that lazy-loading does not escape
+ # the current PERL_STRICTURES_EXTRA setting
+ require Sub::Quote;
+ require Sub::Defer;
+ require Moo;
+ require Moo::Object;
+ require Method::Generate::Accessor;
+ require Method::Generate::Constructor;
+
+ Moo->import;
${^WARNING_BITS} &= ( $initial_fatal_bits | ~ $warnings::DeadBits{all} );
}
# END pre-Moo2 import block
extends 'DBIx::Class';
-use DBIx::Class::_Util qw(sigwarn_silencer qsub);
use namespace::clean;
=head1 NAME
# BEGIN pre-Moo2 import block
BEGIN {
my $initial_fatal_bits = (${^WARNING_BITS}||'') & $warnings::DeadBits{all};
+
local $ENV{PERL_STRICTURES_EXTRA} = 0;
- require Sub::Quote; Sub::Quote->import('quote_sub');
+ # load all of these now, so that lazy-loading does not escape
+ # the current PERL_STRICTURES_EXTRA setting
+ require Sub::Quote;
+ require Sub::Defer;
+
+ Sub::Quote->import('quote_sub');
${^WARNING_BITS} &= ( $initial_fatal_bits | ~ $warnings::DeadBits{all} );
}
sub qsub ($) { goto "e_sub } # no point depping on new Moo just for this
export DBI_DSN="dbi:ODBC:server=NonexistentServerAddress"
export DBI_DRIVER="ADO"
+ # some people do in fact set this - boggle!!!
+ export PERL_STRICTURES_EXTRA=1
# emulate a local::lib-like env
# trick cpanm into executing true as shell - we just need the find+unpack
# 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;
Try::Tiny
Sub::Name
strictures
+ Sub::Defer
Sub::Quote
Scalar::Util
{
register_lazy_loadable_requires(qw(
Moo
+ Moo::Object
+ Method::Generate::Accessor
+ Method::Generate::Constructor
Context::Preserve
Data::Compare
));
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 {
else {
$tb->note("Auto checked $refs_traced references for leaks - none detected");
}
+
+# Disable this until better times - SQLT and probably other things
+# still load strictures. Let's just wait until Moo2.0 and go from there
+=begin for tears
+ # also while we are here and not in plain runmode: make sure we never
+ # loaded any of the strictures XS bullshit (it's a leak in a sense)
+ unless (DBICTest::RunMode->is_plain) {
+ for (qw(indirect multidimensional bareword::filehandles)) {
+ exists $INC{ Module::Runtime::module_notional_filename($_) }
+ and
+ $tb->ok(0, "$_ load apparently attempted!!!" )
+ }
+ }
+=cut
+
}
}