From: Peter Rabbitson Date: Tue, 27 May 2014 08:05:08 +0000 (+0200) Subject: Consolidate lib-wide frameskip, adjust the ::RunMode loading order X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bedbc8111dbbb98f89a36c3cf4e2f6903a4b01be;p=dbsrgits%2FDBIx-Class-Historic.git Consolidate lib-wide frameskip, adjust the ::RunMode loading order --- diff --git a/t/73oracle_hq.t b/t/73oracle_hq.t index 0f887fa..0595edf 100644 --- a/t/73oracle_hq.t +++ b/t/73oracle_hq.t @@ -5,7 +5,6 @@ use Test::Exception; use Test::More; use DBIx::Class::Optional::Dependencies (); use lib qw(t/lib); -use DBICTest::RunMode; $ENV{NLS_SORT} = "BINARY"; $ENV{NLS_COMP} = "BINARY"; diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 6934092..4a9307d 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -37,7 +37,6 @@ BEGIN { } } -use DBICTest::RunMode; use DBICTest::Schema; use DBICTest::Util::LeakTracer qw/populate_weakregistry assert_empty_weakregistry/; use DBICTest::Util 'local_umask'; diff --git a/t/lib/DBICTest/Base.pm b/t/lib/DBICTest/Base.pm new file mode 100644 index 0000000..7d2cb56 --- /dev/null +++ b/t/lib/DBICTest/Base.pm @@ -0,0 +1,12 @@ +package #hide from pause + DBICTest::Base; + +use strict; +use warnings; + +# must load before any DBIx::Class* namespaces +use DBICTest::RunMode; + +sub _skip_namespace_frames { '^DBICTest' } + +1; diff --git a/t/lib/DBICTest/BaseResult.pm b/t/lib/DBICTest/BaseResult.pm index c732181..65f90d1 100644 --- a/t/lib/DBICTest/BaseResult.pm +++ b/t/lib/DBICTest/BaseResult.pm @@ -4,10 +4,7 @@ package #hide from pause use strict; use warnings; -# must load before any DBIx::Class* namespaces -use DBICTest::RunMode; - -use base 'DBIx::Class::Core'; +use base qw(DBICTest::Base DBIx::Class::Core); #use base qw/DBIx::Class::Relationship::Cascade::Rekey DBIx::Class::Core/; diff --git a/t/lib/DBICTest/BaseResultSet.pm b/t/lib/DBICTest/BaseResultSet.pm index 77d22f2..2441cb7 100644 --- a/t/lib/DBICTest/BaseResultSet.pm +++ b/t/lib/DBICTest/BaseResultSet.pm @@ -4,11 +4,7 @@ package #hide from pause use strict; use warnings; -# must load before any DBIx::Class* namespaces -use DBICTest::RunMode; - -use base 'DBIx::Class::ResultSet'; -__PACKAGE__->_skip_namespace_frames('^DBICTest'); +use base qw(DBICTest::Base DBIx::Class::ResultSet); sub all_hri { return [ shift->search ({}, { result_class => 'DBIx::Class::ResultClass::HashRefInflator' })->all ]; diff --git a/t/lib/DBICTest/BaseSchema.pm b/t/lib/DBICTest/BaseSchema.pm index 010e3e9..ea7088a 100644 --- a/t/lib/DBICTest/BaseSchema.pm +++ b/t/lib/DBICTest/BaseSchema.pm @@ -4,9 +4,7 @@ package #hide from pause use strict; use warnings; -# must load before any DBIx::Class* namespaces -use DBICTest::RunMode; +use base qw(DBICTest::Base DBIx::Class::Schema); -use base 'DBIx::Class::Schema'; 1; diff --git a/t/zzzzzzz_sqlite_deadlock.t b/t/zzzzzzz_sqlite_deadlock.t index 6a38d2c..b0e8f3b 100644 --- a/t/zzzzzzz_sqlite_deadlock.t +++ b/t/zzzzzzz_sqlite_deadlock.t @@ -4,10 +4,10 @@ use warnings; use Test::More; use lib 't/lib'; -use DBICTest::RunMode; - -if ( DBICTest::RunMode->is_plain ) { - plan( skip_all => "Skipping test on plain module install" ); +BEGIN { + require DBICTest::RunMode; + plan( skip_all => "Skipping test on plain module install" ) + if DBICTest::RunMode->is_plain; } use Test::Exception;