From: Peter Rabbitson Date: Mon, 29 Feb 2016 10:35:26 +0000 (+0100) Subject: Institute a central "load this first in testing" package X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c0329273268971824784f239f32c7246e68da9c5;p=dbsrgits%2FDBIx-Class-Historic.git Institute a central "load this first in testing" package Instead of the hodge-podge of "what loads first where" make a verified focal package and move some of the stuff within DBICTest::RunMode there There are no other changes aside from the load order --- diff --git a/maint/Makefile.PL.inc/56_autogen_schema_files.pl b/maint/Makefile.PL.inc/56_autogen_schema_files.pl index 6096010..0cd34a0 100644 --- a/maint/Makefile.PL.inc/56_autogen_schema_files.pl +++ b/maint/Makefile.PL.inc/56_autogen_schema_files.pl @@ -1,6 +1,6 @@ require File::Spec; my $test_ddl_fn = File::Spec->catfile(qw( t lib sqlite.sql )); -my @test_ddl_cmd = qw( -I lib -I t/lib -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema ); +my @test_ddl_cmd = qw( -I lib -Mt::lib::ANFANG -- maint/gen_sqlite_schema_files --schema-class DBICTest::Schema ); my $example_ddl_fn = File::Spec->catfile(qw( examples Schema db example.sql )); my $example_db_fn = File::Spec->catfile(qw( examples Schema db example.db )); diff --git a/t/00describe_environment.t b/t/00describe_environment.t index 35e6b02..a88c187 100644 --- a/t/00describe_environment.t +++ b/t/00describe_environment.t @@ -11,9 +11,9 @@ BEGIN { @initial_INC = @INC; } -BEGIN { - unshift @INC, 't/lib'; +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } +BEGIN { if ( "$]" < 5.010) { # Pre-5.10 perls pollute %INC on unsuccesfull module diff --git a/t/05components.t b/t/05components.t index 6313863..b6f2c3e 100644 --- a/t/05components.t +++ b/t/05components.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; use DBICTest::ForeignComponent; diff --git a/t/100extra_source.t b/t/100extra_source.t index 490bbec..b345ce1 100644 --- a/t/100extra_source.t +++ b/t/100extra_source.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; { diff --git a/t/100populate.t b/t/100populate.t index 4b7f929..2817e5b 100644 --- a/t/100populate.t +++ b/t/100populate.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util qw(sigwarn_silencer serialize); use Math::BigInt; diff --git a/t/101populate_rs.t b/t/101populate_rs.t index 5686c3e..7f356d9 100644 --- a/t/101populate_rs.t +++ b/t/101populate_rs.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + ## ---------------------------------------------------------------------------- ## Tests for the $resultset->populate method. ## @@ -14,7 +16,7 @@ use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; diff --git a/t/101source.t b/t/101source.t index 477a4dd..889945b 100644 --- a/t/101source.t +++ b/t/101source.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema; diff --git a/t/102load_classes.t b/t/102load_classes.t index 8936014..ef99b3a 100644 --- a/t/102load_classes.t +++ b/t/102load_classes.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib 't/lib'; + use DBICTest; my $warnings; diff --git a/t/104view.t b/t/104view.t index 4abe7e8..a3668b2 100644 --- a/t/104view.t +++ b/t/104view.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/106dbic_carp.t b/t/106dbic_carp.t index f6bd91d..171e7db 100644 --- a/t/106dbic_carp.t +++ b/t/106dbic_carp.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -7,7 +9,7 @@ BEGIN { $ENV{DBIC_TRACE} = 0 } use Test::More; use Test::Warn; use Test::Exception; -use lib 't/lib'; + use DBICTest; use DBIx::Class::Carp; diff --git a/t/107obj_result_class.t b/t/107obj_result_class.t index f616bcb..d09d5c2 100644 --- a/t/107obj_result_class.t +++ b/t/107obj_result_class.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + package ResultClassInflator; sub new { bless {}, __PACKAGE__ } @@ -11,7 +13,7 @@ use warnings; use Test::More tests => 6; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/18insert_default.t b/t/18insert_default.t index 17657cc..db8fb56 100644 --- a/t/18insert_default.t +++ b/t/18insert_default.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/19retrieve_on_insert.t b/t/19retrieve_on_insert.t index d258180..c8ecf34 100644 --- a/t/19retrieve_on_insert.t +++ b/t/19retrieve_on_insert.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/20setuperrors.t b/t/20setuperrors.t index ede7e29..6095817 100644 --- a/t/20setuperrors.t +++ b/t/20setuperrors.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; use Test::Exception; -use lib 't/lib'; + use DBICTest; throws_ok ( diff --git a/t/26dumper.t b/t/26dumper.t index ade5031..c964655 100644 --- a/t/26dumper.t +++ b/t/26dumper.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; @@ -5,7 +7,7 @@ use Test::More; use Data::Dumper; $Data::Dumper::Sortkeys = 1; -use lib qw(t/lib); + use_ok('DBICTest'); my $schema = DBICTest->init_schema(); diff --git a/t/33exception_wrap.t b/t/33exception_wrap.t index 3b351ab..0acc690 100644 --- a/t/33exception_wrap.t +++ b/t/33exception_wrap.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,8 +7,6 @@ use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); - use DBICTest; my $schema = DBICTest->init_schema; diff --git a/t/34exception_action.t b/t/34exception_action.t index d7885d5..c9c0f6b 100644 --- a/t/34exception_action.t +++ b/t/34exception_action.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; # Set up the "usual" sqlite for DBICTest diff --git a/t/35exception_inaction.t b/t/35exception_inaction.t index 0d8597f..ffbabc5 100644 --- a/t/35exception_inaction.t +++ b/t/35exception_inaction.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib 't/lib'; + use DBICTest::RunMode; BEGIN { if( DBICTest::RunMode->is_plain ) { diff --git a/t/39load_namespaces_1.t b/t/39load_namespaces_1.t index 0f8ae1e..c6355a7 100644 --- a/t/39load_namespaces_1.t +++ b/t/39load_namespaces_1.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; # do not remove even though it is not used my $warnings; diff --git a/t/39load_namespaces_2.t b/t/39load_namespaces_2.t index d9b88fa..e38dfd5 100644 --- a/t/39load_namespaces_2.t +++ b/t/39load_namespaces_2.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; # do not remove even though it is not used plan tests => 6; diff --git a/t/39load_namespaces_3.t b/t/39load_namespaces_3.t index 99ad8a9..144feb6 100644 --- a/t/39load_namespaces_3.t +++ b/t/39load_namespaces_3.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; # do not remove even though it is not used lives_ok (sub { diff --git a/t/39load_namespaces_4.t b/t/39load_namespaces_4.t index 1bdc49d..d0e82ed 100644 --- a/t/39load_namespaces_4.t +++ b/t/39load_namespaces_4.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; # do not remove even though it is not used plan tests => 6; diff --git a/t/39load_namespaces_exception.t b/t/39load_namespaces_exception.t index c5a03df..e0d65ec 100644 --- a/t/39load_namespaces_exception.t +++ b/t/39load_namespaces_exception.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; # do not remove even though it is not used plan tests => 1; diff --git a/t/39load_namespaces_rt41083.t b/t/39load_namespaces_rt41083.t index 2584290..0e33420 100644 --- a/t/39load_namespaces_rt41083.t +++ b/t/39load_namespaces_rt41083.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib 't/lib'; + use DBICTest; # do not remove even though it is not used use Test::More tests => 8; diff --git a/t/39load_namespaces_stress.t b/t/39load_namespaces_stress.t index db178ee..b688669 100644 --- a/t/39load_namespaces_stress.t +++ b/t/39load_namespaces_stress.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Time::HiRes qw/gettimeofday/; -use lib qw(t/lib); + use DBICTest; # do not remove even though it is not used our $src_count = 100; diff --git a/t/40compose_connection.t b/t/40compose_connection.t index 051ab9b..2732a5e 100644 --- a/t/40compose_connection.t +++ b/t/40compose_connection.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; warnings_exist { DBICTest->init_schema( compose_connection => 1, sqlite_use_file => 1 ) } diff --git a/t/46where_attribute.t b/t/46where_attribute.t index f798ace..ba1c7d0 100644 --- a/t/46where_attribute.t +++ b/t/46where_attribute.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/50fork.t b/t/50fork.t index a9fbdec..c3c60ec 100644 --- a/t/50fork.t +++ b/t/50fork.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_pg'; use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $main_pid = $$; diff --git a/t/51threadnodb.t b/t/51threadnodb.t index 3af78d5..4e242f5 100644 --- a/t/51threadnodb.t +++ b/t/51threadnodb.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use Config; BEGIN { unless ($Config{useithreads}) { @@ -17,7 +19,6 @@ use warnings; use Test::More; use DBIx::Class::_Util 'sigwarn_silencer'; -use lib qw(t/lib); use DBICTest; plan skip_all => 'DBIC does not actively support threads before perl 5.8.5' diff --git a/t/51threads.t b/t/51threads.t index ae3addc..0f24f7e 100644 --- a/t/51threads.t +++ b/t/51threads.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use Config; BEGIN { unless ($Config{useithreads}) { @@ -23,7 +25,7 @@ use Test::Exception; plan skip_all => 'DBIC does not actively support threads before perl 5.8.5' if "$]" < 5.008005; -use lib qw(t/lib); + use DBICTest; # README: If you set the env var to a number greater than 10, diff --git a/t/51threadtxn.t b/t/51threadtxn.t index e74c7c1..3e285ca 100644 --- a/t/51threadtxn.t +++ b/t/51threadtxn.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + # README: If you set the env var to a number greater than 10, # we will use that many children @@ -26,7 +28,7 @@ plan skip_all => 'DBIC does not actively support threads before perl 5.8.5' if "$]" < 5.008005; use Scalar::Util 'weaken'; -use lib qw(t/lib); + use DBICTest; my $num_children = $ENV{DBICTEST_THREAD_STRESS} || 1; diff --git a/t/52leaks.t b/t/52leaks.t index c6b64c2..b61856d 100644 --- a/t/52leaks.t +++ b/t/52leaks.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + # work around brain damage in PPerl (yes, it has to be a global) $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /\QUse of "goto" to jump into a construct is deprecated/ @@ -21,7 +23,7 @@ use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest::RunMode; use DBICTest::Util::LeakTracer qw(populate_weakregistry assert_empty_weakregistry visit_refs); use Scalar::Util qw(weaken blessed reftype); diff --git a/t/54taint.t b/t/54taint.t index 6b866e6..fbf0286 100644 --- a/t/54taint.t +++ b/t/54taint.t @@ -1,3 +1,5 @@ +BEGIN { $ENV{DBICTEST_ANFANG_DEFANG} = 1 } + use strict; use warnings; use Config; diff --git a/t/60core.t b/t/60core.t index 595df62..d01a5fd 100644 --- a/t/60core.t +++ b/t/60core.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/61findnot.t b/t/61findnot.t index ab709e3..e9fe1ac 100644 --- a/t/61findnot.t +++ b/t/61findnot.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/63register_class.t b/t/63register_class.t index 6370464..0229713 100644 --- a/t/63register_class.t +++ b/t/63register_class.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More tests => 2; -use lib qw(t/lib); + use DBICTest; use DBICTest::Schema; use DBICTest::Schema::Artist; diff --git a/t/63register_column.t b/t/63register_column.t index 21de95d..7f5d2c3 100644 --- a/t/63register_column.t +++ b/t/63register_column.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; lives_ok { diff --git a/t/63register_source.t b/t/63register_source.t index 6951962..b4eb206 100644 --- a/t/63register_source.t +++ b/t/63register_source.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::Exception tests => 1; -use lib qw(t/lib); + use DBICTest; use DBICTest::Schema; use DBIx::Class::ResultSource::Table; diff --git a/t/64db.t b/t/64db.t index 1a0046d..9f293e2 100644 --- a/t/64db.t +++ b/t/64db.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/65multipk.t b/t/65multipk.t index cd0e108..31c0d41 100644 --- a/t/65multipk.t +++ b/t/65multipk.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/67pager.t b/t/67pager.t index fa7c93a..994cf40 100644 --- a/t/67pager.t +++ b/t/67pager.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/69update.t b/t/69update.t index ea1eaae..bd9d314 100644 --- a/t/69update.t +++ b/t/69update.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/70auto.t b/t/70auto.t index 839c807..4971776 100644 --- a/t/70auto.t +++ b/t/70auto.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/71mysql.t b/t/71mysql.t index 1b967de..9d2c5d0 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_mysql'; use strict; @@ -11,7 +12,7 @@ use B::Deparse; use DBI::Const::GetInfoType; use Scalar::Util qw/weaken/; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/}; diff --git a/t/72pg.t b/t/72pg.t index 71213e8..eda3e03 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_pg'; use strict; @@ -8,8 +9,6 @@ use Test::Exception; use Test::Warn; use Sub::Name; use Config; -use DBIx::Class::Optional::Dependencies (); -use lib qw(t/lib); use DBICTest; use SQL::Abstract 'is_literal_value'; use DBIx::Class::_Util 'is_exception'; diff --git a/t/72pg_bytea.t b/t/72pg_bytea.t index 7049b31..15f8db5 100644 --- a/t/72pg_bytea.t +++ b/t/72pg_bytea.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw(test_rdbms_pg binary_data); use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use DBIx::Class::_Util 'modver_gt_or_eq'; -use lib qw(t/lib); + use DBICTest; my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}; diff --git a/t/73oracle.t b/t/73oracle.t index c6211e2..efbb996 100644 --- a/t/73oracle.t +++ b/t/73oracle.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_oracle'; use strict; @@ -8,7 +9,6 @@ use Test::More; use Sub::Name; use Try::Tiny; -use lib qw(t/lib); use DBICTest; $ENV{NLS_SORT} = "BINARY"; diff --git a/t/73oracle_blob.t b/t/73oracle_blob.t index 0391d4b..a6f6a4e 100644 --- a/t/73oracle_blob.t +++ b/t/73oracle_blob.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_oracle'; use strict; @@ -8,8 +9,6 @@ use Test::More; use Sub::Name; use Try::Tiny; -use lib qw(t/lib); - use DBICTest::Schema::BindType; BEGIN { DBICTest::Schema::BindType->add_columns( diff --git a/t/73oracle_hq.t b/t/73oracle_hq.t index 57bdc2b..0dde669 100644 --- a/t/73oracle_hq.t +++ b/t/73oracle_hq.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_oracle'; use strict; @@ -10,8 +11,6 @@ use Test::More; # dealing with HQs. So just punt on the entire shuffle thing. BEGIN { $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} = 0 } -use lib qw(t/lib); - use DBICTest::Schema::Artist; BEGIN { DBICTest::Schema::Artist->add_column('parentid'); diff --git a/t/745db2.t b/t/745db2.t index 17a6343..34cc2a1 100644 --- a/t/745db2.t +++ b/t/745db2.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_db2'; use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; use Try::Tiny; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_DB2_${_}" } qw/DSN USER PASS/}; diff --git a/t/746db2_400.t b/t/746db2_400.t index b6c4350..c06d4e4 100644 --- a/t/746db2_400.t +++ b/t/746db2_400.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_db2_400'; use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use DBIx::Class::Optional::Dependencies (); -use lib qw(t/lib); + use DBICTest; # Probably best to pass the DBQ option in the DSN to specify a specific diff --git a/t/746mssql.t b/t/746mssql.t index 23778a4..c7753c7 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_mssql_odbc'; use strict; @@ -7,7 +8,7 @@ use Test::More; use Test::Exception; use Try::Tiny; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ODBC_${_}" } qw/DSN USER PASS/}; diff --git a/t/746sybase.t b/t/746sybase.t index 0b8406c..818ed26 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_ase'; use strict; @@ -8,7 +9,6 @@ use Test::More; use Test::Exception; use DBIx::Class::_Util 'sigwarn_silencer'; -use lib qw(t/lib); use DBICTest; my @storage_types = ( diff --git a/t/747mssql_ado.t b/t/747mssql_ado.t index 9c1d084..6fdb8cc 100644 --- a/t/747mssql_ado.t +++ b/t/747mssql_ado.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_mssql_ado'; use strict; @@ -7,7 +8,7 @@ use Test::More; use Test::Exception; use Try::Tiny; use DBIx::Class::Optional::Dependencies (); -use lib qw(t/lib); + use DBICTest; # Example DSN (from frew): diff --git a/t/748informix.t b/t/748informix.t index 08fc4b5..cd9ad35 100644 --- a/t/748informix.t +++ b/t/748informix.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_informix'; use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_INFORMIX_${_}" } qw/DSN USER PASS/}; diff --git a/t/749sqlanywhere.t b/t/749sqlanywhere.t index a52b5bd..d4067b5 100644 --- a/t/749sqlanywhere.t +++ b/t/749sqlanywhere.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -6,7 +8,7 @@ use Test::Exception; use Try::Tiny; use DBIx::Class::Optional::Dependencies (); use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SQLANYWHERE_${_}" } qw/DSN USER PASS/}; diff --git a/t/74mssql.t b/t/74mssql.t index 4f72cc4..5ade8a7 100644 --- a/t/74mssql.t +++ b/t/74mssql.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_rdbms_mssql_sybase'; use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; use Scalar::Util 'weaken'; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_${_}" } qw/DSN USER PASS/}; diff --git a/t/750firebird.t b/t/750firebird.t index 45dd895..b0a2749 100644 --- a/t/750firebird.t +++ b/t/750firebird.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -7,7 +9,7 @@ use DBIx::Class::Optional::Dependencies (); use DBIx::Class::_Util 'scope_guard'; use List::Util 'shuffle'; use Try::Tiny; -use lib qw(t/lib); + use DBICTest; my $env2optdep = { diff --git a/t/751msaccess.t b/t/751msaccess.t index dfd5816..479124a 100644 --- a/t/751msaccess.t +++ b/t/751msaccess.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -6,7 +8,7 @@ use Test::Exception; use Try::Tiny; use DBIx::Class::Optional::Dependencies (); use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSACCESS_ODBC_${_}" } qw/DSN USER PASS/}; diff --git a/t/752sqlite.t b/t/752sqlite.t index f61f07e..fe076d1 100644 --- a/t/752sqlite.t +++ b/t/752sqlite.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -7,7 +9,7 @@ use Test::Warn; use Time::HiRes 'time'; use Math::BigInt; -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util qw( sigwarn_silencer modver_gt_or_eq modver_gt_or_eq_and_lt ); diff --git a/t/76joins.t b/t/76joins.t index d20faec..d98fd5a 100644 --- a/t/76joins.t +++ b/t/76joins.t @@ -1,8 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/76select.t b/t/76select.t index 9d09380..b3b491a 100644 --- a/t/76select.t +++ b/t/76select.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/77join_count.t b/t/77join_count.t index 8350e2e..9de1a83 100644 --- a/t/77join_count.t +++ b/t/77join_count.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/78self_referencial.t b/t/78self_referencial.t index a02677d..fe89bce 100644 --- a/t/78self_referencial.t +++ b/t/78self_referencial.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/79aliasing.t b/t/79aliasing.t index 00e5e93..70738c6 100644 --- a/t/79aliasing.t +++ b/t/79aliasing.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/80unique.t b/t/80unique.t index b380225..726a2b2 100644 --- a/t/80unique.t +++ b/t/80unique.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/82cascade_copy.t b/t/82cascade_copy.t index ec3ba92..505b79b 100644 --- a/t/82cascade_copy.t +++ b/t/82cascade_copy.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/83cache.t b/t/83cache.t index 5812083..a89772d 100644 --- a/t/83cache.t +++ b/t/83cache.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/84serialize.t b/t/84serialize.t index ffa63fa..0cacfc1 100644 --- a/t/84serialize.t +++ b/t/84serialize.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; use Storable qw(dclone freeze nfreeze thaw); use Scalar::Util qw/refaddr/; diff --git a/t/85utf8.t b/t/85utf8.t index e1f2cae..3e44835 100644 --- a/t/85utf8.t +++ b/t/85utf8.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; { diff --git a/t/86might_have.t b/t/86might_have.t index 05ba539..62655e0 100644 --- a/t/86might_have.t +++ b/t/86might_have.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/86sqlt.t b/t/86sqlt.t index a6b17ec..486b5ed 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'deploy'; use strict; @@ -7,7 +8,7 @@ use Test::More; use Test::Warn; use Scalar::Util 'blessed'; -use lib qw(t/lib); + use DBICTest; my $custom_deployment_statements_called = 0; diff --git a/t/87ordered.t b/t/87ordered.t index 1eb079b..219c942 100644 --- a/t/87ordered.t +++ b/t/87ordered.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + # vim: filetype=perl use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; use POSIX (); diff --git a/t/88result_set_column.t b/t/88result_set_column.t index e1b73a3..f27c5dd 100644 --- a/t/88result_set_column.t +++ b/t/88result_set_column.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -10,7 +12,7 @@ use Test::Exception; # and that's a whole another bag of dicks BEGIN { $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} = 0 } -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/90join_torture.t b/t/90join_torture.t index 27111e4..8ba193e 100644 --- a/t/90join_torture.t +++ b/t/90join_torture.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/93autocast.t b/t/93autocast.t index 49c1f57..084f714 100644 --- a/t/93autocast.t +++ b/t/93autocast.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; { # Fake storage driver for sqlite with autocast diff --git a/t/93single_accessor_object.t b/t/93single_accessor_object.t index a285b1a..bcb53a1 100644 --- a/t/93single_accessor_object.t +++ b/t/93single_accessor_object.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; # Test various uses of passing an object to find, create, and update on a single diff --git a/t/94pk_mutation.t b/t/94pk_mutation.t index 3cdc47c..082e5c4 100644 --- a/t/94pk_mutation.t +++ b/t/94pk_mutation.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/94versioning.t b/t/94versioning.t index 9dcdcf1..c3751b2 100644 --- a/t/94versioning.t +++ b/t/94versioning.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw(deploy test_rdbms_mysql); use strict; @@ -11,7 +12,7 @@ use Path::Class; use File::Copy; use Time::HiRes qw/time sleep/; -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/97result_class.t b/t/97result_class.t index faff994..b7e3c47 100644 --- a/t/97result_class.t +++ b/t/97result_class.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/99dbic_sqlt_parser.t b/t/99dbic_sqlt_parser.t index a9e708f..5551833 100644 --- a/t/99dbic_sqlt_parser.t +++ b/t/99dbic_sqlt_parser.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'deploy'; use strict; @@ -10,7 +11,7 @@ use Test::Warn; use Test::Exception; use Scalar::Util (); -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/admin/02ddl.t b/t/admin/02ddl.t index b2414c3..9b6d9e5 100644 --- a/t/admin/02ddl.t +++ b/t/admin/02ddl.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( admin deploy ); use strict; @@ -9,7 +10,7 @@ use Test::Warn; use Path::Class; -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/admin/03data.t b/t/admin/03data.t index d73f619..460a89e 100644 --- a/t/admin/03data.t +++ b/t/admin/03data.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'admin'; use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; -use lib 't/lib'; + use DBICTest; use DBIx::Class::Admin; diff --git a/t/cdbi/01-columns.t b/t/cdbi/01-columns.t index 76bce52..827684d 100644 --- a/t/cdbi/01-columns.t +++ b/t/cdbi/01-columns.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/02-Film.t b/t/cdbi/02-Film.t index 7a6f9e9..95a460f 100644 --- a/t/cdbi/02-Film.t +++ b/t/cdbi/02-Film.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/03-subclassing.t b/t/cdbi/03-subclassing.t index 8a73a09..b5ac32f 100644 --- a/t/cdbi/03-subclassing.t +++ b/t/cdbi/03-subclassing.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/04-lazy.t b/t/cdbi/04-lazy.t index 2e37827..96d5743 100644 --- a/t/cdbi/04-lazy.t +++ b/t/cdbi/04-lazy.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/06-hasa.t b/t/cdbi/06-hasa.t index d191b65..6d47c12 100644 --- a/t/cdbi/06-hasa.t +++ b/t/cdbi/06-hasa.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/08-inheritcols.t b/t/cdbi/08-inheritcols.t index bc9b90a..eabe09e 100644 --- a/t/cdbi/08-inheritcols.t +++ b/t/cdbi/08-inheritcols.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/09-has_many.t b/t/cdbi/09-has_many.t index a19500a..bac11ed 100644 --- a/t/cdbi/09-has_many.t +++ b/t/cdbi/09-has_many.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/11-triggers.t b/t/cdbi/11-triggers.t index cd322e5..5f346d0 100644 --- a/t/cdbi/11-triggers.t +++ b/t/cdbi/11-triggers.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/12-filter.t b/t/cdbi/12-filter.t index de68fa1..f39b848 100644 --- a/t/cdbi/12-filter.t +++ b/t/cdbi/12-filter.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/13-constraint.t b/t/cdbi/13-constraint.t index ba9f654..bd7bb98 100644 --- a/t/cdbi/13-constraint.t +++ b/t/cdbi/13-constraint.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/14-might_have.t b/t/cdbi/14-might_have.t index 52a2abd..9b332c7 100644 --- a/t/cdbi/14-might_have.t +++ b/t/cdbi/14-might_have.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/15-accessor.t b/t/cdbi/15-accessor.t index 85f8464..5b34966 100644 --- a/t/cdbi/15-accessor.t +++ b/t/cdbi/15-accessor.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/16-reserved.t b/t/cdbi/16-reserved.t index ce8a4b3..cc01d80 100644 --- a/t/cdbi/16-reserved.t +++ b/t/cdbi/16-reserved.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/18-has_a.t b/t/cdbi/18-has_a.t index dfb5819..a7b069c 100644 --- a/t/cdbi/18-has_a.t +++ b/t/cdbi/18-has_a.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/19-set_sql.t b/t/cdbi/19-set_sql.t index a981810..14cfc37 100644 --- a/t/cdbi/19-set_sql.t +++ b/t/cdbi/19-set_sql.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/21-iterator.t b/t/cdbi/21-iterator.t index 14a1b30..49e8ec9 100644 --- a/t/cdbi/21-iterator.t +++ b/t/cdbi/21-iterator.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/22-deflate_order.t b/t/cdbi/22-deflate_order.t index 71d8d7d..a54eaf7 100644 --- a/t/cdbi/22-deflate_order.t +++ b/t/cdbi/22-deflate_order.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( cdbicompat test_rdbms_mysql Time::Piece::MySQL>=0 ); $| = 1; diff --git a/t/cdbi/22-self_referential.t b/t/cdbi/22-self_referential.t index 43ad050..a70f5d1 100644 --- a/t/cdbi/22-self_referential.t +++ b/t/cdbi/22-self_referential.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/23-cascade.t b/t/cdbi/23-cascade.t index 809f458..c66cffb 100644 --- a/t/cdbi/23-cascade.t +++ b/t/cdbi/23-cascade.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/24-meta_info.t b/t/cdbi/24-meta_info.t index 703e3fd..7004de1 100644 --- a/t/cdbi/24-meta_info.t +++ b/t/cdbi/24-meta_info.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( cdbicompat Time::Piece>=0 ); use strict; diff --git a/t/cdbi/26-mutator.t b/t/cdbi/26-mutator.t index 54a4229..7042731 100644 --- a/t/cdbi/26-mutator.t +++ b/t/cdbi/26-mutator.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/30-pager.t b/t/cdbi/30-pager.t index d192d97..eaac340 100644 --- a/t/cdbi/30-pager.t +++ b/t/cdbi/30-pager.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/68-inflate_has_a.t b/t/cdbi/68-inflate_has_a.t index 37eac4b..6398494 100644 --- a/t/cdbi/68-inflate_has_a.t +++ b/t/cdbi/68-inflate_has_a.t @@ -1,10 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt cdbicompat ); use strict; use warnings; use Test::More; -use lib 't/lib'; + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/cdbi/70_implicit_inflate.t b/t/cdbi/70_implicit_inflate.t index fa53816..1c58f2c 100644 --- a/t/cdbi/70_implicit_inflate.t +++ b/t/cdbi/70_implicit_inflate.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( cdbicompat rdbms_sqlite ic_dt ); use strict; diff --git a/t/cdbi/71_column_object.t b/t/cdbi/71_column_object.t index e00820b..54b0f41 100644 --- a/t/cdbi/71_column_object.t +++ b/t/cdbi/71_column_object.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + # Columns in CDBI could be defined as Class::DBI::Column objects rather than # or as well as with __PACKAGE__->columns(); use DBIx::Class::Optional::Dependencies -skip_all_without => qw( cdbicompat Class::DBI>=3.000005 ); diff --git a/t/cdbi/98-failure.t b/t/cdbi/98-failure.t index 9a993c4..becb8c4 100644 --- a/t/cdbi/98-failure.t +++ b/t/cdbi/98-failure.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/DeepAbstractSearch/01_search.t b/t/cdbi/DeepAbstractSearch/01_search.t index f4911c7..8b2101a 100644 --- a/t/cdbi/DeepAbstractSearch/01_search.t +++ b/t/cdbi/DeepAbstractSearch/01_search.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( cdbicompat Class::DBI::Plugin::DeepAbstractSearch>=0 ); use strict; @@ -5,7 +6,6 @@ use warnings; use Test::More; -use lib 't/lib'; use DBICTest; my $DB = DBICTest->_sqlite_dbname(sqlite_use_file => 1);; diff --git a/t/cdbi/abstract/search_where.t b/t/cdbi/abstract/search_where.t index 2c15ecc..28e5b04 100644 --- a/t/cdbi/abstract/search_where.t +++ b/t/cdbi/abstract/search_where.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/columns_as_hashes.t b/t/cdbi/columns_as_hashes.t index 9731ae3..a8953c3 100644 --- a/t/cdbi/columns_as_hashes.t +++ b/t/cdbi/columns_as_hashes.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/columns_dont_override_custom_accessors.t b/t/cdbi/columns_dont_override_custom_accessors.t index 5748b6e..2e99668 100644 --- a/t/cdbi/columns_dont_override_custom_accessors.t +++ b/t/cdbi/columns_dont_override_custom_accessors.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/construct.t b/t/cdbi/construct.t index d10e6a1..5040b06 100644 --- a/t/cdbi/construct.t +++ b/t/cdbi/construct.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/copy.t b/t/cdbi/copy.t index f587ae0..2741aad 100644 --- a/t/cdbi/copy.t +++ b/t/cdbi/copy.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/early_column_heisenbug.t b/t/cdbi/early_column_heisenbug.t index e91b401..8ecea27 100644 --- a/t/cdbi/early_column_heisenbug.t +++ b/t/cdbi/early_column_heisenbug.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/has_many_loads_foreign_class.t b/t/cdbi/has_many_loads_foreign_class.t index 5485972..a0af15a 100644 --- a/t/cdbi/has_many_loads_foreign_class.t +++ b/t/cdbi/has_many_loads_foreign_class.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/hasa_without_loading.t b/t/cdbi/hasa_without_loading.t index 3b92c4d..e365fd5 100644 --- a/t/cdbi/hasa_without_loading.t +++ b/t/cdbi/hasa_without_loading.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/max_min_value_of.t b/t/cdbi/max_min_value_of.t index aba3821..aff1dd7 100644 --- a/t/cdbi/max_min_value_of.t +++ b/t/cdbi/max_min_value_of.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/mk_group_accessors.t b/t/cdbi/mk_group_accessors.t index 5fc1994..fdd9600 100644 --- a/t/cdbi/mk_group_accessors.t +++ b/t/cdbi/mk_group_accessors.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/multi_column_set.t b/t/cdbi/multi_column_set.t index 1f1d1ac..cf0632a 100644 --- a/t/cdbi/multi_column_set.t +++ b/t/cdbi/multi_column_set.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/object_cache.t b/t/cdbi/object_cache.t index db0dc06..378395a 100644 --- a/t/cdbi/object_cache.t +++ b/t/cdbi/object_cache.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/retrieve_from_sql_with_limit.t b/t/cdbi/retrieve_from_sql_with_limit.t index 4045361..b209ba0 100644 --- a/t/cdbi/retrieve_from_sql_with_limit.t +++ b/t/cdbi/retrieve_from_sql_with_limit.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; diff --git a/t/cdbi/set_to_undef.t b/t/cdbi/set_to_undef.t index 5b642e0..149be2c 100644 --- a/t/cdbi/set_to_undef.t +++ b/t/cdbi/set_to_undef.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt cdbicompat ); use strict; diff --git a/t/cdbi/set_vs_DateTime.t b/t/cdbi/set_vs_DateTime.t index 2fe0879..05d66b5 100644 --- a/t/cdbi/set_vs_DateTime.t +++ b/t/cdbi/set_vs_DateTime.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt cdbicompat ); use strict; diff --git a/t/cdbi/sweet/08pager.t b/t/cdbi/sweet/08pager.t index 7f94e51..b91f897 100644 --- a/t/cdbi/sweet/08pager.t +++ b/t/cdbi/sweet/08pager.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; -use lib 't/lib'; + use DBICTest; DBICTest::Schema::CD->load_components(qw/CDBICompat CDBICompat::Pager/); diff --git a/t/cdbi/testlib/DBIC/Test/SQLite.pm b/t/cdbi/testlib/DBIC/Test/SQLite.pm index 76822cd..72aa0c1 100644 --- a/t/cdbi/testlib/DBIC/Test/SQLite.pm +++ b/t/cdbi/testlib/DBIC/Test/SQLite.pm @@ -39,7 +39,6 @@ table, and tie it to the class. # change too much BEGIN { $ENV{DBIC_SHUFFLE_UNORDERED_RESULTSETS} = 0 } -use lib 't/lib'; use DBICTest; use base qw/DBIx::Class/; diff --git a/t/cdbi/testlib/MyBase.pm b/t/cdbi/testlib/MyBase.pm index 1fe9317..8cffd74 100644 --- a/t/cdbi/testlib/MyBase.pm +++ b/t/cdbi/testlib/MyBase.pm @@ -5,8 +5,6 @@ use warnings; use strict; use DBI; - -use lib 't/lib'; use DBICTest; use base qw(DBIx::Class::CDBICompat); diff --git a/t/count/count_rs.t b/t/count/count_rs.t index 174f630..7afd11e 100644 --- a/t/count/count_rs.t +++ b/t/count/count_rs.t @@ -1,8 +1,8 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib qw(t/lib); - use Test::More; use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/count/distinct.t b/t/count/distinct.t index e916ab9..edd3d35 100644 --- a/t/count/distinct.t +++ b/t/count/distinct.t @@ -1,11 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); - use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/count/group_by_func.t b/t/count/group_by_func.t index 661cc9e..14f3f8a 100644 --- a/t/count/group_by_func.t +++ b/t/count/group_by_func.t @@ -1,10 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; - -use lib qw(t/lib); - use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/count/grouped_pager.t b/t/count/grouped_pager.t index 6bb6153..5c23fad 100644 --- a/t/count/grouped_pager.t +++ b/t/count/grouped_pager.t @@ -1,10 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; - -use lib qw(t/lib); - use DBICTest; plan tests => 7; diff --git a/t/count/in_subquery.t b/t/count/in_subquery.t index 85f48d0..765815d 100644 --- a/t/count/in_subquery.t +++ b/t/count/in_subquery.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/count/joined.t b/t/count/joined.t index bb8eb4c..e6f3afa 100644 --- a/t/count/joined.t +++ b/t/count/joined.t @@ -1,10 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; - -use lib qw(t/lib); - use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/count/prefetch.t b/t/count/prefetch.t index eb18236..07a5d28 100644 --- a/t/count/prefetch.t +++ b/t/count/prefetch.t @@ -1,8 +1,8 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib qw(t/lib); - use Test::More; use DBICTest ':DiffSQL'; diff --git a/t/count/search_related.t b/t/count/search_related.t index 11f5796..0ebf8e4 100644 --- a/t/count/search_related.t +++ b/t/count/search_related.t @@ -1,10 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; - -use lib qw(t/lib); - use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/delete/cascade_missing.t b/t/delete/cascade_missing.t index 8bd8a76..54270e8 100644 --- a/t/delete/cascade_missing.t +++ b/t/delete/cascade_missing.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,7 +7,7 @@ use Test::More; use Test::Warn; use Test::Exception; -use lib 't/lib'; + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/delete/complex.t b/t/delete/complex.t index 149bcf1..11ef35b 100644 --- a/t/delete/complex.t +++ b/t/delete/complex.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/delete/m2m.t b/t/delete/m2m.t index 7a1628d..cd29518 100644 --- a/t/delete/m2m.t +++ b/t/delete/m2m.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/delete/related.t b/t/delete/related.t index d4dc26b..f009709 100644 --- a/t/delete/related.t +++ b/t/delete/related.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/icdt/core.t b/t/icdt/core.t index 8f0c83c..5af1ac3 100644 --- a/t/icdt/core.t +++ b/t/icdt/core.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( test_rdbms_sqlite ic_dt ); use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/icdt/datetime_missing_deps.t b/t/icdt/datetime_missing_deps.t index 680a3f1..f2f864a 100644 --- a/t/icdt/datetime_missing_deps.t +++ b/t/icdt/datetime_missing_deps.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $no_class = '_DBICTEST_NONEXISTENT_CLASS_'; diff --git a/t/icdt/engine_specific/firebird.t b/t/icdt/engine_specific/firebird.t index 05ef381..493b41f 100644 --- a/t/icdt/engine_specific/firebird.t +++ b/t/icdt/engine_specific/firebird.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt _rdbms_firebird_common ); use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my $env2optdep = { diff --git a/t/icdt/engine_specific/informix.t b/t/icdt/engine_specific/informix.t index 4a6231c..2ca980c 100644 --- a/t/icdt/engine_specific/informix.t +++ b/t/icdt/engine_specific/informix.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt test_rdbms_informix ); use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_INFORMIX_${_}" } qw/DSN USER PASS/}; diff --git a/t/icdt/engine_specific/msaccess.t b/t/icdt/engine_specific/msaccess.t index 9e647fb..a3cb63c 100644 --- a/t/icdt/engine_specific/msaccess.t +++ b/t/icdt/engine_specific/msaccess.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt _rdbms_msaccess_common ); use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Try::Tiny; use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my @tdeps = qw( test_rdbms_msaccess_odbc test_rdbms_msaccess_ado ); diff --git a/t/icdt/engine_specific/mssql.t b/t/icdt/engine_specific/mssql.t index e65a994..2756858 100644 --- a/t/icdt/engine_specific/mssql.t +++ b/t/icdt/engine_specific/mssql.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt _rdbms_mssql_common ); use strict; @@ -7,7 +8,7 @@ use Test::More; use Test::Exception; use Try::Tiny; use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my @tdeps = qw( test_rdbms_mssql_odbc test_rdbms_mssql_sybase test_rdbms_mssql_ado ); diff --git a/t/icdt/engine_specific/oracle.t b/t/icdt/engine_specific/oracle.t index 4dc94b3..778a578 100644 --- a/t/icdt/engine_specific/oracle.t +++ b/t/icdt/engine_specific/oracle.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt test_rdbms_oracle ); use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; # DateTime::Format::Oracle needs this set diff --git a/t/icdt/engine_specific/sqlanywhere.t b/t/icdt/engine_specific/sqlanywhere.t index 0bac9dc..00e9d56 100644 --- a/t/icdt/engine_specific/sqlanywhere.t +++ b/t/icdt/engine_specific/sqlanywhere.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt _rdbms_sqlanywhere_common ); use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my @tdeps = qw( test_rdbms_sqlanywhere test_rdbms_sqlanywhere_odbc ); diff --git a/t/icdt/engine_specific/sqlite.t b/t/icdt/engine_specific/sqlite.t index f9b3210..297372c 100644 --- a/t/icdt/engine_specific/sqlite.t +++ b/t/icdt/engine_specific/sqlite.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt test_rdbms_sqlite ); use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Warn; use Try::Tiny; -use lib qw(t/lib); + use DBICTest; # Test offline parser determination (formerly t/inflate/datetime_determine_parser.t) diff --git a/t/icdt/engine_specific/sybase.t b/t/icdt/engine_specific/sybase.t index c63944e..72a8bdb 100644 --- a/t/icdt/engine_specific/sybase.t +++ b/t/icdt/engine_specific/sybase.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt test_rdbms_ase ); use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; use DBIx::Class::_Util 'scope_guard'; -use lib qw(t/lib); + use DBICTest; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/}; diff --git a/t/icdt/offline_mysql.t b/t/icdt/offline_mysql.t index 91bd3f6..a865ef5 100644 --- a/t/icdt/offline_mysql.t +++ b/t/icdt/offline_mysql.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt_mysql ); use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; use DBICTest::Schema; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/icdt/offline_pg.t b/t/icdt/offline_pg.t index 0c0cb9b..1a04fce 100644 --- a/t/icdt/offline_pg.t +++ b/t/icdt/offline_pg.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => qw( ic_dt_pg ); use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; DBICTest::Schema->load_classes('EventTZPg'); diff --git a/t/inflate/file_column.t b/t/inflate/file_column.t index 1b69e51..acbf46b 100644 --- a/t/inflate/file_column.t +++ b/t/inflate/file_column.t @@ -1,10 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); - - use DBICTest; use DBICTest::Schema; use File::Compare; diff --git a/t/inflate/hri.t b/t/inflate/hri.t index b5e9d2f..0564cad 100644 --- a/t/inflate/hri.t +++ b/t/inflate/hri.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -11,7 +13,7 @@ BEGIN { } use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/inflate/hri_torture.t b/t/inflate/hri_torture.t index 92aa2d8..c0b763e 100644 --- a/t/inflate/hri_torture.t +++ b/t/inflate/hri_torture.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Deep; -use lib qw(t/lib); + use DBICTest; # More tests like this in t/prefetch/manual.t diff --git a/t/inflate/serialize.t b/t/inflate/serialize.t index 63c31aa..2da0347 100644 --- a/t/inflate/serialize.t +++ b/t/inflate/serialize.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/lib/ANFANG.pm b/t/lib/ANFANG.pm new file mode 100644 index 0000000..444cf41 --- /dev/null +++ b/t/lib/ANFANG.pm @@ -0,0 +1,126 @@ +package # hide from pauses + ANFANG; + +# load-time critical +BEGIN { + if ( $ENV{RELEASE_TESTING} ) { + require warnings and warnings->import; + require strict and strict->import; + } + + # allow 'use ANFANG' to work after it's been do()ne + $INC{"ANFANG.pm"} ||= __FILE__; + $INC{"t/lib/ANFANG.pm"} ||= __FILE__; + $INC{"./t/lib/ANFANG.pm"} ||= __FILE__; +} + +BEGIN { + + # load-me-first sanity check + if ( + + # nobody shut us off + ! $ENV{DBICTEST_ANFANG_DEFANG} + + and + + # if this is set - all bets are off + ! $ENV{PERL5OPT} + + and + + # -d:Confess / -d:TraceUse and the like + ! $^P + + and + + # just don't check anything under RELEASE_TESTING + # a naive approach would be to simply whitelist both + # strict and warnings, but pre 5.10 there were even + # more modules loaded by these two: + # + # perlbrew exec perl -Mstrict -Mwarnings -e 'warn join "\n", sort keys %INC' + # + ! $ENV{RELEASE_TESTING} + + and + + my @undesirables = grep { + + ($INC{$_}||'') ne __FILE__ + + and + + # allow direct loads via -M + $_ !~ m{^ DBICTest (?: /Schema )? \.pm $}x + + } keys %INC + + ) { + + my ( $fr, @frame ); + while (@frame = caller(++$fr)) { + last if $frame[1] !~ m{ (?: \A | [\/\\] ) t [\/\\] lib [\/\\] }x; + } + + die __FILE__ . " must be loaded before any other module (i.e. @{[ join ', ', map { qq('$_') } sort @undesirables ]}) at $frame[1] line $frame[2]\n"; + } + + + if ( $ENV{DBICTEST_VERSION_WARNS_INDISCRIMINATELY} ) { + my $ov = UNIVERSAL->can("VERSION"); + + require Carp; + + # not loading warnings.pm + local $^W = 0; + + *UNIVERSAL::VERSION = sub { + Carp::carp( 'Argument "blah bleh bloh" isn\'t numeric in subroutine entry' ); + &$ov; + }; + } + + + if ( + $ENV{DBICTEST_ASSERT_NO_SPURIOUS_EXCEPTION_ACTION} + or + # keep it always on during CI + ( + ($ENV{TRAVIS}||'') eq 'true' + and + ($ENV{TRAVIS_REPO_SLUG}||'') =~ m|\w+/dbix-class$| + ) + ) { + require Try::Tiny; + my $orig = \&Try::Tiny::try; + + # not loading warnings.pm + local $^W = 0; + + *Try::Tiny::try = sub (&;@) { + my ($fr, $first_pkg) = 0; + while( $first_pkg = caller($fr++) ) { + last if $first_pkg !~ /^ + __ANON__ + | + \Q(eval)\E + $/x; + } + + if ($first_pkg =~ /DBIx::Class/) { + require Test::Builder; + Test::Builder->new->ok(0, + 'Using try{} within DBIC internals is a mistake - use dbic_internal_try{} instead' + ); + } + + goto $orig; + }; + } + +} + +use lib 't/lib'; + +1; diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 849caa1..ad3bf3c 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -1,10 +1,12 @@ package # hide from PAUSE DBICTest; +# load early so that `perl -It/lib -MDBICTest` keeps working +use ANFANG; + use strict; use warnings; - # this noop trick initializes the STDOUT, so that the TAP::Harness # issued IO::Select->can_read calls (which are blocking wtf wtf wtf) # keep spinning and scheduling jobs @@ -39,9 +41,12 @@ DBICTest - Library to be used by DBIx::Class test scripts =head1 SYNOPSIS - use lib qw(t/lib); - use DBICTest; + BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + + use warnings; + use strict; use Test::More; + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/lib/DBICTest/Base.pm b/t/lib/DBICTest/Base.pm index 7d2cb56..9024f8e 100644 --- a/t/lib/DBICTest/Base.pm +++ b/t/lib/DBICTest/Base.pm @@ -4,8 +4,7 @@ package #hide from pause use strict; use warnings; -# must load before any DBIx::Class* namespaces -use DBICTest::RunMode; +use DBICTest::Util; sub _skip_namespace_frames { '^DBICTest' } diff --git a/t/lib/DBICTest/RunMode.pm b/t/lib/DBICTest/RunMode.pm index 590abde..178378e 100644 --- a/t/lib/DBICTest/RunMode.pm +++ b/t/lib/DBICTest/RunMode.pm @@ -4,64 +4,6 @@ package # hide from PAUSE use strict; use warnings; -BEGIN { - if ($INC{'DBIx/Class.pm'}) { - my ($fr, @frame) = 1; - while (@frame = caller($fr++)) { - last if $frame[1] !~ m|^t/lib/DBICTest|; - } - - die __PACKAGE__ . " must be loaded before DBIx::Class (or modules using DBIx::Class) at $frame[1] line $frame[2]\n"; - } - - if ( $ENV{DBICTEST_VERSION_WARNS_INDISCRIMINATELY} ) { - my $ov = UNIVERSAL->can("VERSION"); - - require Carp; - - no warnings 'redefine'; - *UNIVERSAL::VERSION = sub { - Carp::carp( 'Argument "blah bleh bloh" isn\'t numeric in subroutine entry' ); - &$ov; - }; - } - - if ( - $ENV{DBICTEST_ASSERT_NO_SPURIOUS_EXCEPTION_ACTION} - or - # keep it always on during CI - ( - ($ENV{TRAVIS}||'') eq 'true' - and - ($ENV{TRAVIS_REPO_SLUG}||'') =~ m|\w+/dbix-class$| - ) - ) { - require Try::Tiny; - my $orig = \&Try::Tiny::try; - - no warnings 'redefine'; - *Try::Tiny::try = sub (&;@) { - my ($fr, $first_pkg) = 0; - while( $first_pkg = caller($fr++) ) { - last if $first_pkg !~ /^ - __ANON__ - | - \Q(eval)\E - $/x; - } - - if ($first_pkg =~ /DBIx::Class/) { - require Test::Builder; - Test::Builder->new->ok(0, - 'Using try{} within DBIC internals is a mistake - use dbic_internal_try{} instead' - ); - } - - goto $orig; - }; - } -} - use Path::Class qw/file dir/; use Fcntl ':DEFAULT'; use File::Spec (); diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index 2e783a7..1b436f6 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -1,6 +1,9 @@ package # hide from PAUSE DBICTest::Schema; +# load early so that `perl -It/lib -MDBICTest::Schema` keeps working +use ANFANG; + use strict; use warnings; no warnings 'qw'; diff --git a/t/lib/DBICTest/Util.pm b/t/lib/DBICTest/Util.pm index 27f7527..cbbce35 100644 --- a/t/lib/DBICTest/Util.pm +++ b/t/lib/DBICTest/Util.pm @@ -3,6 +3,8 @@ package DBICTest::Util; use warnings; use strict; +use ANFANG; + use constant DEBUG_TEST_CONCURRENCY_LOCKS => ( ($ENV{DBICTEST_DEBUG_CONCURRENCY_LOCKS}||'') =~ /^(\d+)$/ )[0] || diff --git a/t/lib/DBICTest/Util/LeakTracer.pm b/t/lib/DBICTest/Util/LeakTracer.pm index b1de109..134ca63 100644 --- a/t/lib/DBICTest/Util/LeakTracer.pm +++ b/t/lib/DBICTest/Util/LeakTracer.pm @@ -3,10 +3,12 @@ package DBICTest::Util::LeakTracer; use warnings; use strict; +use ANFANG; use Carp; use Scalar::Util qw(isweak weaken blessed reftype); use DBIx::Class::_Util qw(refcount hrefaddr refdesc); use DBIx::Class::Optional::Dependencies; +use DBICTest::RunMode; use Data::Dumper::Concise; use DBICTest::Util qw( stacktrace visit_namespaces ); use constant { diff --git a/t/multi_create/cd_single.t b/t/multi_create/cd_single.t index 746eaab..2549cb7 100644 --- a/t/multi_create/cd_single.t +++ b/t/multi_create/cd_single.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/multi_create/diamond.t b/t/multi_create/diamond.t index 499f7a1..ce0efab 100644 --- a/t/multi_create/diamond.t +++ b/t/multi_create/diamond.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; sub mc_diag { diag (@_) if $ENV{DBIC_MULTICREATE_DEBUG} }; diff --git a/t/multi_create/existing_in_chain.t b/t/multi_create/existing_in_chain.t index 292dd6b..e7a7d47 100644 --- a/t/multi_create/existing_in_chain.t +++ b/t/multi_create/existing_in_chain.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/multi_create/find_or_multicreate.t b/t/multi_create/find_or_multicreate.t index 762b962..6efc974 100644 --- a/t/multi_create/find_or_multicreate.t +++ b/t/multi_create/find_or_multicreate.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema( no_populate => 1 ); diff --git a/t/multi_create/has_many.t b/t/multi_create/has_many.t index 2878ff7..2e40d7b 100644 --- a/t/multi_create/has_many.t +++ b/t/multi_create/has_many.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/multi_create/in_memory.t b/t/multi_create/in_memory.t index 9533af5..c96db68 100644 --- a/t/multi_create/in_memory.t +++ b/t/multi_create/in_memory.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/multi_create/insert_defaults.t b/t/multi_create/insert_defaults.t index 3425b8a..d7839c1 100644 --- a/t/multi_create/insert_defaults.t +++ b/t/multi_create/insert_defaults.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/multi_create/m2m.t b/t/multi_create/m2m.t index 26934c9..879453f 100644 --- a/t/multi_create/m2m.t +++ b/t/multi_create/m2m.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; plan tests => 4; diff --git a/t/multi_create/multilev_single_PKeqFK.t b/t/multi_create/multilev_single_PKeqFK.t index 9a5adbe..301e80b 100644 --- a/t/multi_create/multilev_single_PKeqFK.t +++ b/t/multi_create/multilev_single_PKeqFK.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; sub mc_diag { diag (@_) if $ENV{DBIC_MULTICREATE_DEBUG} }; diff --git a/t/multi_create/standard.t b/t/multi_create/standard.t index 54cf04e..784a409 100644 --- a/t/multi_create/standard.t +++ b/t/multi_create/standard.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/multi_create/torture.t b/t/multi_create/torture.t index 79338d7..269a062 100644 --- a/t/multi_create/torture.t +++ b/t/multi_create/torture.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; plan tests => 23; diff --git a/t/ordered/cascade_delete.t b/t/ordered/cascade_delete.t index b6633c7..62463fa 100644 --- a/t/ordered/cascade_delete.t +++ b/t/ordered/cascade_delete.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/ordered/unordered_movement.t b/t/ordered/unordered_movement.t index dc08306..1684b2f 100644 --- a/t/ordered/unordered_movement.t +++ b/t/ordered/unordered_movement.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/attrs_untouched.t b/t/prefetch/attrs_untouched.t index b2f25c3..ce99b42 100644 --- a/t/prefetch/attrs_untouched.t +++ b/t/prefetch/attrs_untouched.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; -use lib qw(t/lib); + use DBICTest; use Data::Dumper; diff --git a/t/prefetch/correlated.t b/t/prefetch/correlated.t index 5196620..e941b12 100644 --- a/t/prefetch/correlated.t +++ b/t/prefetch/correlated.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Deep; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/count.t b/t/prefetch/count.t index f973575..8a32b41 100644 --- a/t/prefetch/count.t +++ b/t/prefetch/count.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/diamond.t b/t/prefetch/diamond.t index f7a21e0..dc3e22c 100644 --- a/t/prefetch/diamond.t +++ b/t/prefetch/diamond.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + # Test if prefetch and join in diamond relationship fetching the correct rows use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/double_prefetch.t b/t/prefetch/double_prefetch.t index fa0b79f..2942d23 100644 --- a/t/prefetch/double_prefetch.t +++ b/t/prefetch/double_prefetch.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/empty_cache.t b/t/prefetch/empty_cache.t index 9f42d5a..c7cda22 100644 --- a/t/prefetch/empty_cache.t +++ b/t/prefetch/empty_cache.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/false_colvalues.t b/t/prefetch/false_colvalues.t index 468a27a..a87de70 100644 --- a/t/prefetch/false_colvalues.t +++ b/t/prefetch/false_colvalues.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; use Test::Deep; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema( no_populate => 1 ); diff --git a/t/prefetch/grouped.t b/t/prefetch/grouped.t index 0f6f59a..4aad6b1 100644 --- a/t/prefetch/grouped.t +++ b/t/prefetch/grouped.t @@ -1,9 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/prefetch/incomplete.t b/t/prefetch/incomplete.t index 63e431a..114ccfb 100644 --- a/t/prefetch/incomplete.t +++ b/t/prefetch/incomplete.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Deep; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/join_type.t b/t/prefetch/join_type.t index f2980e7..5165e09 100644 --- a/t/prefetch/join_type.t +++ b/t/prefetch/join_type.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/lazy_cursor.t b/t/prefetch/lazy_cursor.t index de6e936..3ed3c7c 100644 --- a/t/prefetch/lazy_cursor.t +++ b/t/prefetch/lazy_cursor.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/manual.t b/t/prefetch/manual.t index e051ce3..83870ae 100644 --- a/t/prefetch/manual.t +++ b/t/prefetch/manual.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,7 +7,7 @@ use Test::More; use Test::Deep; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; delete $ENV{DBIC_COLUMNS_INCLUDE_FILTER_RELS}; diff --git a/t/prefetch/multiple_hasmany.t b/t/prefetch/multiple_hasmany.t index 665005b..7af0888 100644 --- a/t/prefetch/multiple_hasmany.t +++ b/t/prefetch/multiple_hasmany.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/multiple_hasmany_torture.t b/t/prefetch/multiple_hasmany_torture.t index d3998e0..cd503dd 100644 --- a/t/prefetch/multiple_hasmany_torture.t +++ b/t/prefetch/multiple_hasmany_torture.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Deep; use Test::Exception; -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/prefetch/o2m_o2m_order_by_with_limit.t b/t/prefetch/o2m_o2m_order_by_with_limit.t index 65a2c39..fc447a2 100644 --- a/t/prefetch/o2m_o2m_order_by_with_limit.t +++ b/t/prefetch/o2m_o2m_order_by_with_limit.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/prefetch/one_to_many_to_one.t b/t/prefetch/one_to_many_to_one.t index f79b38e..f8a4fcd 100644 --- a/t/prefetch/one_to_many_to_one.t +++ b/t/prefetch/one_to_many_to_one.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/refined_search_on_relation.t b/t/prefetch/refined_search_on_relation.t index 729dbde..e27687c 100644 --- a/t/prefetch/refined_search_on_relation.t +++ b/t/prefetch/refined_search_on_relation.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/restricted_children_set.t b/t/prefetch/restricted_children_set.t index 9b0f3ee..5ad56bf 100644 --- a/t/prefetch/restricted_children_set.t +++ b/t/prefetch/restricted_children_set.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/standard.t b/t/prefetch/standard.t index 75107c7..bf86315 100644 --- a/t/prefetch/standard.t +++ b/t/prefetch/standard.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/via_search_related.t b/t/prefetch/via_search_related.t index 316035d..846b333 100644 --- a/t/prefetch/via_search_related.t +++ b/t/prefetch/via_search_related.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/prefetch/with_limit.t b/t/prefetch/with_limit.t index 28b3b8a..5b1bb83 100644 --- a/t/prefetch/with_limit.t +++ b/t/prefetch/with_limit.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + # Test to ensure we get a consistent result set wether or not we use the # prefetch option in combination rows (LIMIT). use strict; @@ -5,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/relationship/after_update.t b/t/relationship/after_update.t index 7ec8d00..cc4e4be 100644 --- a/t/relationship/after_update.t +++ b/t/relationship/after_update.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/core.t b/t/relationship/core.t index 87f635e..9955ce6 100644 --- a/t/relationship/core.t +++ b/t/relationship/core.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/custom.t b/t/relationship/custom.t index b9bf5fa..32c8cf8 100644 --- a/t/relationship/custom.t +++ b/t/relationship/custom.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/custom_opaque.t b/t/relationship/custom_opaque.t index 1139c6a..6e701c4 100644 --- a/t/relationship/custom_opaque.t +++ b/t/relationship/custom_opaque.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib 't/lib'; + use DBICTest; my $schema = DBICTest->init_schema( no_populate => 1, quote_names => 1 ); diff --git a/t/relationship/custom_with_null_in_cond.t b/t/relationship/custom_with_null_in_cond.t index e7a7acb..b396014 100644 --- a/t/relationship/custom_with_null_in_cond.t +++ b/t/relationship/custom_with_null_in_cond.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib 't/lib'; + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/doesnt_exist.t b/t/relationship/doesnt_exist.t index 7575122..9133dee 100644 --- a/t/relationship/doesnt_exist.t +++ b/t/relationship/doesnt_exist.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/dynamic_foreign_columns.t b/t/relationship/dynamic_foreign_columns.t index a9fc254..ecc24c5 100644 --- a/t/relationship/dynamic_foreign_columns.t +++ b/t/relationship/dynamic_foreign_columns.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; require DBICTest::DynamicForeignCols::TestComputer; diff --git a/t/relationship/info.t b/t/relationship/info.t index 4f349d4..fd1bfa8 100644 --- a/t/relationship/info.t +++ b/t/relationship/info.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; # diff --git a/t/relationship/proxy.t b/t/relationship/proxy.t index ec9847d..93a0a66 100644 --- a/t/relationship/proxy.t +++ b/t/relationship/proxy.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/resolve_relationship_condition.t b/t/relationship/resolve_relationship_condition.t index 1d4cb62..a999dc6 100644 --- a/t/relationship/resolve_relationship_condition.t +++ b/t/relationship/resolve_relationship_condition.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib 't/lib'; + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/set_column_on_fk.t b/t/relationship/set_column_on_fk.t index 9f49427..df2adc9 100644 --- a/t/relationship/set_column_on_fk.t +++ b/t/relationship/set_column_on_fk.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/update_or_create_multi.t b/t/relationship/update_or_create_multi.t index 5dde83d..5986126 100644 --- a/t/relationship/update_or_create_multi.t +++ b/t/relationship/update_or_create_multi.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/relationship/update_or_create_single.t b/t/relationship/update_or_create_single.t index a0e31fb..bb4f808 100644 --- a/t/relationship/update_or_create_single.t +++ b/t/relationship/update_or_create_single.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/as_query.t b/t/resultset/as_query.t index 3b43e9c..09b5186 100644 --- a/t/resultset/as_query.t +++ b/t/resultset/as_query.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/as_subselect_rs.t b/t/resultset/as_subselect_rs.t index 6d75977..edfcae7 100644 --- a/t/resultset/as_subselect_rs.t +++ b/t/resultset/as_subselect_rs.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/bind_attr.t b/t/resultset/bind_attr.t index 7f25d99..a636cfc 100644 --- a/t/resultset/bind_attr.t +++ b/t/resultset/bind_attr.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/resultset/create_with_rs_inherited_values.t b/t/resultset/create_with_rs_inherited_values.t index 8a0acd3..bc47950 100644 --- a/t/resultset/create_with_rs_inherited_values.t +++ b/t/resultset/create_with_rs_inherited_values.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,7 +7,7 @@ use Test::More; use Test::Exception; use Math::BigInt; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/find_on_subquery_cond.t b/t/resultset/find_on_subquery_cond.t index af2ca51..ec02d6b 100644 --- a/t/resultset/find_on_subquery_cond.t +++ b/t/resultset/find_on_subquery_cond.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/inflate_result_api.t b/t/resultset/inflate_result_api.t index e6bedc2..6f5b0a8 100644 --- a/t/resultset/inflate_result_api.t +++ b/t/resultset/inflate_result_api.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; no warnings 'exiting'; use Test::More; use Test::Deep; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(no_populate => 1); diff --git a/t/resultset/inflatemap_abuse.t b/t/resultset/inflatemap_abuse.t index 9c60765..0289891 100644 --- a/t/resultset/inflatemap_abuse.t +++ b/t/resultset/inflatemap_abuse.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; # From http://lists.scsys.co.uk/pipermail/dbix-class/2013-February/011119.html diff --git a/t/resultset/is_ordered.t b/t/resultset/is_ordered.t index 39595a4..a183458 100644 --- a/t/resultset/is_ordered.t +++ b/t/resultset/is_ordered.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib qw(t/lib); + use Test::More; use DBICTest; diff --git a/t/resultset/is_paged.t b/t/resultset/is_paged.t index 4f6af63..020afa0 100644 --- a/t/resultset/is_paged.t +++ b/t/resultset/is_paged.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib qw(t/lib); + use Test::More; use DBICTest; diff --git a/t/resultset/nulls_only.t b/t/resultset/nulls_only.t index 7f53d6d..a8d965c 100644 --- a/t/resultset/nulls_only.t +++ b/t/resultset/nulls_only.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib qw(t/lib); + use Test::More; use DBICTest; diff --git a/t/resultset/plus_select.t b/t/resultset/plus_select.t index db55ac4..d63adad 100644 --- a/t/resultset/plus_select.t +++ b/t/resultset/plus_select.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Math::BigInt; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/resultset/rowparser_internals.t b/t/resultset/rowparser_internals.t index e89369f..2511684 100644 --- a/t/resultset/rowparser_internals.t +++ b/t/resultset/rowparser_internals.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; use B::Deparse; use DBIx::Class::_Util 'perlstring'; diff --git a/t/resultset/update_delete.t b/t/resultset/update_delete.t index 30e3797..46f690a 100644 --- a/t/resultset/update_delete.t +++ b/t/resultset/update_delete.t @@ -1,7 +1,8 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib qw(t/lib); use Test::More; use Test::Exception; diff --git a/t/resultset_class.t b/t/resultset_class.t index 607c1f2..43054a5 100644 --- a/t/resultset_class.t +++ b/t/resultset_class.t @@ -1,11 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Class::Inspector (); -unshift(@INC, './t/lib'); -use lib 't/lib'; - use DBICTest; is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICTest::BaseResultSet', 'default resultset class'); diff --git a/t/resultset_overload.t b/t/resultset_overload.t index 164d2ee..8fb22e3 100644 --- a/t/resultset_overload.t +++ b/t/resultset_overload.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/resultsource/bare_resultclass_exception.t b/t/resultsource/bare_resultclass_exception.t index 6b8d72c..0db9efd 100644 --- a/t/resultsource/bare_resultclass_exception.t +++ b/t/resultsource/bare_resultclass_exception.t @@ -1,10 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib 't/lib'; use DBICTest; { diff --git a/t/resultsource/set_primary_key.t b/t/resultsource/set_primary_key.t index 1f9de7d..e46ad64 100644 --- a/t/resultsource/set_primary_key.t +++ b/t/resultsource/set_primary_key.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib 't/lib'; + use DBICTest; throws_ok { diff --git a/t/row/copy_with_extra_selection.t b/t/row/copy_with_extra_selection.t index c1e3df4..86c49b6 100644 --- a/t/row/copy_with_extra_selection.t +++ b/t/row/copy_with_extra_selection.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/row/filter_column.t b/t/row/filter_column.t index 7823fa5..af7a951 100644 --- a/t/row/filter_column.t +++ b/t/row/filter_column.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $from_storage_ran = 0; diff --git a/t/row/find_one_has_many.t b/t/row/find_one_has_many.t index ea7767f..51d8db4 100644 --- a/t/row/find_one_has_many.t +++ b/t/row/find_one_has_many.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/row/inflate_result.t b/t/row/inflate_result.t index 3327b70..f2f6b80 100644 --- a/t/row/inflate_result.t +++ b/t/row/inflate_result.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; -use lib qw(t/lib); + use DBICTest; package My::Schema::Result::User; diff --git a/t/row/pkless.t b/t/row/pkless.t index ac090de..f11f31c 100644 --- a/t/row/pkless.t +++ b/t/row/pkless.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/row/set_extra_column.t b/t/row/set_extra_column.t index 0debaaf..cd95305 100644 --- a/t/row/set_extra_column.t +++ b/t/row/set_extra_column.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/row/sourceless.t b/t/row/sourceless.t index 85ae3ee..4da0899 100644 --- a/t/row/sourceless.t +++ b/t/row/sourceless.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $row = DBICTest::Schema::CD->new({ title => 'foo' }); diff --git a/t/schema/anon.t b/t/schema/anon.t index 4d74ace..18b04b5 100644 --- a/t/schema/anon.t +++ b/t/schema/anon.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; lives_ok (sub { diff --git a/t/schema/clone.t b/t/schema/clone.t index 86b7a47..877da18 100644 --- a/t/schema/clone.t +++ b/t/schema/clone.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/search/distinct.t b/t/search/distinct.t index 4a80267..08c6717 100644 --- a/t/search/distinct.t +++ b/t/search/distinct.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/search/empty_attrs.t b/t/search/empty_attrs.t index 3b52487..cb4cff7 100644 --- a/t/search/empty_attrs.t +++ b/t/search/empty_attrs.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/search/preserve_original_rs.t b/t/search/preserve_original_rs.t index 9f6704f..9a087e7 100644 --- a/t/search/preserve_original_rs.t +++ b/t/search/preserve_original_rs.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::_Util 'serialize'; diff --git a/t/search/reentrancy.t b/t/search/reentrancy.t index 8790603..ad4b4e5 100644 --- a/t/search/reentrancy.t +++ b/t/search/reentrancy.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/search/related_has_many.t b/t/search/related_has_many.t index 91b1fb7..572aebf 100644 --- a/t/search/related_has_many.t +++ b/t/search/related_has_many.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/search/related_strip_prefetch.t b/t/search/related_strip_prefetch.t index 5e34fe9..cf80061 100644 --- a/t/search/related_strip_prefetch.t +++ b/t/search/related_strip_prefetch.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/search/select_chains.t b/t/search/select_chains.t index ed8f23b..31692d3 100644 --- a/t/search/select_chains.t +++ b/t/search/select_chains.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/search/select_chains_unbalanced.t b/t/search/select_chains_unbalanced.t index 63de73c..471cae2 100644 --- a/t/search/select_chains_unbalanced.t +++ b/t/search/select_chains_unbalanced.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/search/stack_cond.t b/t/search/stack_cond.t index 9a0e806..4c06a5d 100644 --- a/t/search/stack_cond.t +++ b/t/search/stack_cond.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use SQL::Abstract qw(is_plain_value is_literal_value); use List::Util 'shuffle'; diff --git a/t/search/subquery.t b/t/search/subquery.t index 8c3fcf7..8b785e4 100644 --- a/t/search/subquery.t +++ b/t/search/subquery.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/sqlmaker/bind_transport.t b/t/sqlmaker/bind_transport.t index 3097191..aacd59c 100644 --- a/t/sqlmaker/bind_transport.t +++ b/t/sqlmaker/bind_transport.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,7 +7,7 @@ use Test::More; use Test::Exception; use Math::BigInt; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/sqlmaker/core.t b/t/sqlmaker/core.t index 1c2a1c3..4e19ed7 100644 --- a/t/sqlmaker/core.t +++ b/t/sqlmaker/core.t @@ -1,10 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(no_deploy => 1); diff --git a/t/sqlmaker/core_quoted.t b/t/sqlmaker/core_quoted.t index 8e45566..d483a40 100644 --- a/t/sqlmaker/core_quoted.t +++ b/t/sqlmaker/core_quoted.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/sqlmaker/dbihacks_internals.t b/t/sqlmaker/dbihacks_internals.t index ca81737..cf75a26 100644 --- a/t/sqlmaker/dbihacks_internals.t +++ b/t/sqlmaker/dbihacks_internals.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::_Util 'UNRESOLVABLE_CONDITION'; diff --git a/t/sqlmaker/hierarchical/oracle.t b/t/sqlmaker/hierarchical/oracle.t index 3495e85..62e6776 100644 --- a/t/sqlmaker/hierarchical/oracle.t +++ b/t/sqlmaker/hierarchical/oracle.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'id_shortener'; use strict; @@ -5,7 +6,6 @@ use warnings; use Test::More; -use lib qw(t/lib); use DBICTest::Schema::Artist; BEGIN { DBICTest::Schema::Artist->add_column('parentid'); diff --git a/t/sqlmaker/legacy_joins.t b/t/sqlmaker/legacy_joins.t index 1c93c35..2ecc0ef 100644 --- a/t/sqlmaker/legacy_joins.t +++ b/t/sqlmaker/legacy_joins.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::_Util 'sigwarn_silencer'; diff --git a/t/sqlmaker/limit_dialects/basic.t b/t/sqlmaker/limit_dialects/basic.t index 7098f1d..85872bb 100644 --- a/t/sqlmaker/limit_dialects/basic.t +++ b/t/sqlmaker/limit_dialects/basic.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/sqlmaker/limit_dialects/custom.t b/t/sqlmaker/limit_dialects/custom.t index 89c4788..da6da39 100644 --- a/t/sqlmaker/limit_dialects/custom.t +++ b/t/sqlmaker/limit_dialects/custom.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; # This is legacy stuff from SQL::Absract::Limit diff --git a/t/sqlmaker/limit_dialects/fetch_first.t b/t/sqlmaker/limit_dialects/fetch_first.t index ab3e170..625a464 100644 --- a/t/sqlmaker/limit_dialects/fetch_first.t +++ b/t/sqlmaker/limit_dialects/fetch_first.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/sqlmaker/limit_dialects/first_skip.t b/t/sqlmaker/limit_dialects/first_skip.t index acaf770..5eff585 100644 --- a/t/sqlmaker/limit_dialects/first_skip.t +++ b/t/sqlmaker/limit_dialects/first_skip.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/sqlmaker/limit_dialects/generic_subq.t b/t/sqlmaker/limit_dialects/generic_subq.t index 2d4beda..916ef35 100644 --- a/t/sqlmaker/limit_dialects/generic_subq.t +++ b/t/sqlmaker/limit_dialects/generic_subq.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use List::Util 'min'; use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/sqlmaker/limit_dialects/mssql_torture.t b/t/sqlmaker/limit_dialects/mssql_torture.t index e452953..67cdbcd 100644 --- a/t/sqlmaker/limit_dialects/mssql_torture.t +++ b/t/sqlmaker/limit_dialects/mssql_torture.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; my $OFFSET = DBIx::Class::SQLMaker::LimitDialects->__offset_bindtype; diff --git a/t/sqlmaker/limit_dialects/rno.t b/t/sqlmaker/limit_dialects/rno.t index b317792..4cbe91f 100644 --- a/t/sqlmaker/limit_dialects/rno.t +++ b/t/sqlmaker/limit_dialects/rno.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/sqlmaker/limit_dialects/rownum.t b/t/sqlmaker/limit_dialects/rownum.t index 806bba4..b7bb9df 100644 --- a/t/sqlmaker/limit_dialects/rownum.t +++ b/t/sqlmaker/limit_dialects/rownum.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/sqlmaker/limit_dialects/skip_first.t b/t/sqlmaker/limit_dialects/skip_first.t index a87b95e..91f1f98 100644 --- a/t/sqlmaker/limit_dialects/skip_first.t +++ b/t/sqlmaker/limit_dialects/skip_first.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::LimitDialects; diff --git a/t/sqlmaker/limit_dialects/toplimit.t b/t/sqlmaker/limit_dialects/toplimit.t index 3fb03d9..e1c40b8 100644 --- a/t/sqlmaker/limit_dialects/toplimit.t +++ b/t/sqlmaker/limit_dialects/toplimit.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/sqlmaker/limit_dialects/torture.t b/t/sqlmaker/limit_dialects/torture.t index 4dac672..03c8822 100644 --- a/t/sqlmaker/limit_dialects/torture.t +++ b/t/sqlmaker/limit_dialects/torture.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::_Util 'deep_clone'; diff --git a/t/sqlmaker/literal_with_bind.t b/t/sqlmaker/literal_with_bind.t index 1024a62..a3dbcc7 100644 --- a/t/sqlmaker/literal_with_bind.t +++ b/t/sqlmaker/literal_with_bind.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(no_populate => 1); diff --git a/t/sqlmaker/msaccess.t b/t/sqlmaker/msaccess.t index 179b3f3..8797b1e 100644 --- a/t/sqlmaker/msaccess.t +++ b/t/sqlmaker/msaccess.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; # the entire point of the subclass is that parenthesis have to be diff --git a/t/sqlmaker/mysql.t b/t/sqlmaker/mysql.t index 0e2ad29..f1e3bfb 100644 --- a/t/sqlmaker/mysql.t +++ b/t/sqlmaker/mysql.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest::Schema->connect (DBICTest->_database, { quote_char => '`' }); diff --git a/t/sqlmaker/nest_deprec.t b/t/sqlmaker/nest_deprec.t index a6edeee..232274e 100644 --- a/t/sqlmaker/nest_deprec.t +++ b/t/sqlmaker/nest_deprec.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/sqlmaker/oracle.t b/t/sqlmaker/oracle.t index cd3e629..31fc496 100644 --- a/t/sqlmaker/oracle.t +++ b/t/sqlmaker/oracle.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'id_shortener'; use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; use Data::Dumper::Concise; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::Oracle; diff --git a/t/sqlmaker/oraclejoin.t b/t/sqlmaker/oraclejoin.t index 11298b0..de49bbf 100644 --- a/t/sqlmaker/oraclejoin.t +++ b/t/sqlmaker/oraclejoin.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'id_shortener'; use strict; @@ -5,7 +6,6 @@ use warnings; use Test::More; -use lib qw(t/lib); use DBICTest ':DiffSQL'; use DBIx::Class::SQLMaker::OracleJoins; diff --git a/t/sqlmaker/order_by_bindtransport.t b/t/sqlmaker/order_by_bindtransport.t index 24da80e..f99a191 100644 --- a/t/sqlmaker/order_by_bindtransport.t +++ b/t/sqlmaker/order_by_bindtransport.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; use Data::Dumper::Concise; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; sub test_order { diff --git a/t/sqlmaker/order_by_func.t b/t/sqlmaker/order_by_func.t index 9609219..3ba4a17 100644 --- a/t/sqlmaker/order_by_func.t +++ b/t/sqlmaker/order_by_func.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema(); diff --git a/t/sqlmaker/quotes.t b/t/sqlmaker/quotes.t index 4a5357b..f76ffb9 100644 --- a/t/sqlmaker/quotes.t +++ b/t/sqlmaker/quotes.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema( no_deploy => 1 ); diff --git a/t/sqlmaker/sqlite.t b/t/sqlmaker/sqlite.t index 9c0b904..1c948c5 100644 --- a/t/sqlmaker/sqlite.t +++ b/t/sqlmaker/sqlite.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest ':DiffSQL'; my $schema = DBICTest->init_schema; diff --git a/t/storage/base.t b/t/storage/base.t index b7650a8..e40745a 100644 --- a/t/storage/base.t +++ b/t/storage/base.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; use Data::Dumper; diff --git a/t/storage/cursor.t b/t/storage/cursor.t index ce0be84..93a3161 100644 --- a/t/storage/cursor.t +++ b/t/storage/cursor.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(cursor_class => 'DBICTest::Cursor'); diff --git a/t/storage/dbh_do.t b/t/storage/dbh_do.t index 727c245..1511f82 100644 --- a/t/storage/dbh_do.t +++ b/t/storage/dbh_do.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; diff --git a/t/storage/dbi_coderef.t b/t/storage/dbi_coderef.t index b5b7961..4bbae78 100644 --- a/t/storage/dbi_coderef.t +++ b/t/storage/dbi_coderef.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; plan tests => 1; diff --git a/t/storage/dbi_env.t b/t/storage/dbi_env.t index 462da11..4e71ce5 100644 --- a/t/storage/dbi_env.t +++ b/t/storage/dbi_env.t @@ -1,6 +1,8 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; -use lib qw(t/lib); + use DBICTest; use Test::More; use Test::Exception; diff --git a/t/storage/dbic_pretty.t b/t/storage/dbic_pretty.t index 1a1c32e..89f12dd 100644 --- a/t/storage/dbic_pretty.t +++ b/t/storage/dbic_pretty.t @@ -1,9 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_prettydebug'; use strict; use warnings; -use lib qw(t/lib); + use DBICTest; use Test::More; diff --git a/t/storage/debug.t b/t/storage/debug.t index 3f5d399..e3cef38 100644 --- a/t/storage/debug.t +++ b/t/storage/debug.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; no warnings 'once'; @@ -15,7 +17,7 @@ use Test::More; use Test::Exception; use Try::Tiny; use File::Spec; -use lib qw(t/lib); + use DBICTest; use Path::Class qw/file/; diff --git a/t/storage/deploy.t b/t/storage/deploy.t index 3a1f66f..64c2438 100644 --- a/t/storage/deploy.t +++ b/t/storage/deploy.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'deploy'; use strict; @@ -7,7 +8,7 @@ use Test::More; use Test::Exception; use Path::Class qw/dir/; -use lib qw(t/lib); + use DBICTest; local $ENV{DBI_DSN}; diff --git a/t/storage/deprecated_exception_source_bind_attrs.t b/t/storage/deprecated_exception_source_bind_attrs.t index f6dca5a..3a6c2dd 100644 --- a/t/storage/deprecated_exception_source_bind_attrs.t +++ b/t/storage/deprecated_exception_source_bind_attrs.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; { diff --git a/t/storage/disable_sth_caching.t b/t/storage/disable_sth_caching.t index 494780d..5fc8e18 100644 --- a/t/storage/disable_sth_caching.t +++ b/t/storage/disable_sth_caching.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; BEGIN { $ENV{DBICTEST_VIA_REPLICATED} = 0 } use Test::More; -use lib qw(t/lib); + use DBICTest; ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/t/storage/error.t b/t/storage/error.t index e01da70..3cb7a28 100644 --- a/t/storage/error.t +++ b/t/storage/error.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,7 +7,7 @@ use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; for my $conn_args ( diff --git a/t/storage/exception.t b/t/storage/exception.t index d96e336..3de6aa9 100644 --- a/t/storage/exception.t +++ b/t/storage/exception.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; use DBICTest::Schema; diff --git a/t/storage/global_destruction.t b/t/storage/global_destruction.t index 6bddfd7..674c116 100644 --- a/t/storage/global_destruction.t +++ b/t/storage/global_destruction.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -8,7 +10,7 @@ BEGIN { $ENV{DBIC_STORAGE_RETRY_DEBUG} = 1 } use DBIx::Class::Optional::Dependencies (); -use lib qw(t/lib); + use DBICTest; for my $type (qw/PG MYSQL SQLite/) { diff --git a/t/storage/nobindvars.t b/t/storage/nobindvars.t index b229756..61eb3d2 100644 --- a/t/storage/nobindvars.t +++ b/t/storage/nobindvars.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; { # Fake storage driver for SQLite + no bind variables diff --git a/t/storage/on_connect_call.t b/t/storage/on_connect_call.t index 265835c..c881055 100644 --- a/t/storage/on_connect_call.t +++ b/t/storage/on_connect_call.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; no warnings qw/once redefine/; -use lib qw(t/lib); + use DBI; use DBICTest; use DBICTest::Schema; diff --git a/t/storage/on_connect_do.t b/t/storage/on_connect_do.t index 6fccbb1..28a7e3a 100644 --- a/t/storage/on_connect_do.t +++ b/t/storage/on_connect_do.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -10,7 +12,7 @@ use Test::More tests => 13; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; require DBI; diff --git a/t/storage/ping_count.t b/t/storage/ping_count.t index 28af647..4d472e7 100644 --- a/t/storage/ping_count.t +++ b/t/storage/ping_count.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $ping_count = 0; diff --git a/t/storage/prefer_stringification.t b/t/storage/prefer_stringification.t index ffb292a..e1d3aa0 100644 --- a/t/storage/prefer_stringification.t +++ b/t/storage/prefer_stringification.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; -use lib qw(t/lib); + use DBICTest; { diff --git a/t/storage/quote_names.t b/t/storage/quote_names.t index ac65fa0..08fcd00 100644 --- a/t/storage/quote_names.t +++ b/t/storage/quote_names.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Data::Dumper::Concise; use Try::Tiny; -use lib qw(t/lib); + use DBICTest; my %expected = ( diff --git a/t/storage/reconnect.t b/t/storage/reconnect.t index fc97ebd..199213b 100644 --- a/t/storage/reconnect.t +++ b/t/storage/reconnect.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -7,7 +9,7 @@ use File::Copy 'move'; use Scalar::Util 'weaken'; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $db_orig = DBICTest->_sqlite_dbfilename; diff --git a/t/storage/replicated.t b/t/storage/replicated.t index 82c809d..8696ba2 100644 --- a/t/storage/replicated.t +++ b/t/storage/replicated.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_replicated'; use strict; @@ -5,7 +6,7 @@ use warnings; use Test::More; use DBIx::Class::_Util 'modver_gt_or_eq_and_lt'; -use lib qw(t/lib); + use DBICTest; BEGIN { diff --git a/t/storage/savepoints.t b/t/storage/savepoints.t index b0f3858..f99c9d5 100644 --- a/t/storage/savepoints.t +++ b/t/storage/savepoints.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,7 +7,7 @@ use Test::More; use Test::Exception; use DBIx::Class::_Util qw(modver_gt_or_eq sigwarn_silencer scope_guard); -use lib qw(t/lib); + use DBICTest; { diff --git a/t/storage/stats.t b/t/storage/stats.t index c164399..58fbde0 100644 --- a/t/storage/stats.t +++ b/t/storage/stats.t @@ -1,11 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; plan tests => 12; -use lib qw(t/lib); - use_ok('DBICTest'); my $schema = DBICTest->init_schema(); diff --git a/t/storage/txn.t b/t/storage/txn.t index f8e1b35..9a462bf 100644 --- a/t/storage/txn.t +++ b/t/storage/txn.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $code = sub { diff --git a/t/storage/txn_scope_guard.t b/t/storage/txn_scope_guard.t index 6c6d1df..56d602d 100644 --- a/t/storage/txn_scope_guard.t +++ b/t/storage/txn_scope_guard.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -8,7 +10,7 @@ use Test::Exception; use List::Util 'shuffle'; use DBIx::Class::_Util 'sigwarn_silencer'; -use lib qw(t/lib); + use DBICTest; # Test txn_scope_guard diff --git a/t/update/all.t b/t/update/all.t index acc8387..920e17c 100644 --- a/t/update/all.t +++ b/t/update/all.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/update/ident_cond.t b/t/update/ident_cond.t index d7d4cf0..6979255 100644 --- a/t/update/ident_cond.t +++ b/t/update/ident_cond.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/update/type_aware.t b/t/update/type_aware.t index fd58319..eb8ac26 100644 --- a/t/update/type_aware.t +++ b/t/update/type_aware.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/t/zzzzzzz_authors.t b/t/zzzzzzz_authors.t index a46a247..18b771f 100644 --- a/t/zzzzzzz_authors.t +++ b/t/zzzzzzz_authors.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More 'no_plan'; -use lib 't/lib'; + use DBICTest::RunMode; my $authorcount = scalar do { diff --git a/t/zzzzzzz_perl_perf_bug.t b/t/zzzzzzz_perl_perf_bug.t index 4434e1c..85dd77c 100644 --- a/t/zzzzzzz_perl_perf_bug.t +++ b/t/zzzzzzz_perl_perf_bug.t @@ -1,7 +1,9 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + BEGIN { plan skip_all => diff --git a/xt/dist/authors.t b/xt/dist/authors.t index 8ee1bf3..ff7d5e2 100644 --- a/xt/dist/authors.t +++ b/xt/dist/authors.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; diff --git a/xt/dist/loadable_standalone_testschema_resultclasses.t b/xt/dist/loadable_standalone_testschema_resultclasses.t index f0dd2ac..27629a7 100644 --- a/xt/dist/loadable_standalone_testschema_resultclasses.t +++ b/xt/dist/loadable_standalone_testschema_resultclasses.t @@ -1,8 +1,11 @@ +BEGIN { + delete $ENV{DBICTEST_VERSION_WARNS_INDISCRIMINATELY}; + do "./t/lib/ANFANG.pm" or die ( $@ || $! ) +} + use warnings; use strict; -BEGIN { delete $ENV{DBICTEST_VERSION_WARNS_INDISCRIMINATELY} } - use DBIx::Class::_Util 'sigwarn_silencer'; use if DBIx::Class::_ENV_::BROKEN_FORK, 'threads'; @@ -10,9 +13,6 @@ use Test::More; use File::Find; use Time::HiRes 'sleep'; - -use lib 't/lib'; - my $worker = sub { my $fn = shift; diff --git a/xt/dist/pod_coverage.t b/xt/dist/pod_coverage.t index 1f3195a..a3acbe4 100644 --- a/xt/dist/pod_coverage.t +++ b/xt/dist/pod_coverage.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_podcoverage'; use warnings; @@ -6,7 +7,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 lib 'maint/.Generated_Pod/lib'; use DBICTest; use namespace::clean; diff --git a/xt/dist/postdistdir/pod_validity.t b/xt/dist/postdistdir/pod_validity.t index 773e5ac..49291ad 100644 --- a/xt/dist/postdistdir/pod_validity.t +++ b/xt/dist/postdistdir/pod_validity.t @@ -1,10 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_pod'; use warnings; use strict; use Test::More; -use lib qw(t/lib); + use DBICTest; # this has already been required but leave it here for CPANTS static analysis diff --git a/xt/dist/postdistdir/whitespace.t b/xt/dist/postdistdir/whitespace.t index 3576da6..9b2ba87 100644 --- a/xt/dist/postdistdir/whitespace.t +++ b/xt/dist/postdistdir/whitespace.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_whitespace'; use warnings; @@ -5,7 +6,7 @@ use strict; use Test::More; use File::Glob 'bsd_glob'; -use lib 't/lib'; + use DBICTest ':GlobalLock'; # FIXME - temporary workaround for RT#82032, RT#82033 diff --git a/xt/dist/strictures.t b/xt/dist/strictures.t index 70efc7c..c896c95 100644 --- a/xt/dist/strictures.t +++ b/xt/dist/strictures.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_strictures'; use warnings; @@ -7,7 +8,7 @@ use Test::More; use File::Find; use File::Spec; use Config; -use lib 't/lib'; + use DBICTest; # The rationale is - if we can load all our optdeps @@ -42,7 +43,9 @@ find({ | t/lib/DBICTest/Util/OverrideRequire.pm # no stictures by design (load order sensitive) | - lib/DBIx/Class/Optional/Dependencies.pm # no stictures by design (load spee sensitive) + t/lib/ANFANG.pm # no stictures by design (load speed sensitive) + | + lib/DBIx/Class/Optional/Dependencies.pm # no stictures by design (load speed sensitive) )$}x; my $f = $_; diff --git a/xt/extra/c3_mro.t b/xt/extra/c3_mro.t index 55effb5..ae40404 100644 --- a/xt/extra/c3_mro.t +++ b/xt/extra/c3_mro.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; -use lib qw(t/lib); + use DBICTest; # do not remove even though it is not used (pulls in MRO::Compat if needed) { diff --git a/xt/extra/dbicadmin.t b/xt/extra/dbicadmin.t index cc79190..3f05ac2 100644 --- a/xt/extra/dbicadmin.t +++ b/xt/extra/dbicadmin.t @@ -1,18 +1,20 @@ -use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_admin_script'; - -use strict; -use warnings; - BEGIN { # just in case the user env has stuff in it delete $ENV{JSON_ANY_ORDER}; delete $ENV{DBICTEST_VERSION_WARNS_INDISCRIMINATELY}; + + do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } +use strict; +use warnings; + +use DBIx::Class::Optional::Dependencies -skip_all_without => 'test_admin_script'; + use Test::More; use Config; use File::Spec; -use lib qw(t/lib); + use DBICTest; $ENV{PATH} = ''; @@ -71,7 +73,7 @@ sub test_dbicadmin { my ($perl) = $^X =~ /(.*)/; - open(my $fh, "-|", ( $perl, '-MDBICTest::RunMode', 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!; + open(my $fh, "-|", ( $perl, '-MANFANG', 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!; my $data = do { local $/; <$fh> }; close($fh); if (!ok( ($data=~/Aran.*Trout/s), "$ENV{JSON_ANY_ORDER}: select with attrs" )) { @@ -101,7 +103,7 @@ sub default_args { sub test_exec { my ($perl) = $^X =~ /(.*)/; - my @args = ($perl, '-MDBICTest::RunMode', File::Spec->catfile(qw(script dbicadmin)), @_); + my @args = ($perl, '-MANFANG', File::Spec->catfile(qw(script dbicadmin)), @_); if ($^O eq 'MSWin32') { require Win32::ShellQuote; # included in test optdeps diff --git a/xt/extra/diagnostics/deprecated_rs_attributes.t b/xt/extra/diagnostics/deprecated_rs_attributes.t index 8eed20b..2f458c0 100644 --- a/xt/extra/diagnostics/deprecated_rs_attributes.t +++ b/xt/extra/diagnostics/deprecated_rs_attributes.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/xt/extra/diagnostics/malformed_rel_declaration.t b/xt/extra/diagnostics/malformed_rel_declaration.t index a1abdb7..70a803e 100644 --- a/xt/extra/diagnostics/malformed_rel_declaration.t +++ b/xt/extra/diagnostics/malformed_rel_declaration.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest::Schema::Artist; my $pkg = 'DBICTest::Schema::Artist'; diff --git a/xt/extra/diagnostics/many_to_many_warning.t b/xt/extra/diagnostics/many_to_many_warning.t index 2c42091..c416e41 100644 --- a/xt/extra/diagnostics/many_to_many_warning.t +++ b/xt/extra/diagnostics/many_to_many_warning.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $exp_warn = qr/The many-to-many relationship 'bars' is trying to create/; diff --git a/xt/extra/diagnostics/resultset_manager.t b/xt/extra/diagnostics/resultset_manager.t index fad560d..28c2d9d 100644 --- a/xt/extra/diagnostics/resultset_manager.t +++ b/xt/extra/diagnostics/resultset_manager.t @@ -1,9 +1,11 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Warn; -use lib qw(t/lib); + use DBICTest; warnings_exist { require DBICTest::ResultSetManager } diff --git a/xt/extra/diagnostics/search_in_void_ctx.t b/xt/extra/diagnostics/search_in_void_ctx.t index 95a040f..d63ee1c 100644 --- a/xt/extra/diagnostics/search_in_void_ctx.t +++ b/xt/extra/diagnostics/search_in_void_ctx.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(no_deploy => 1); diff --git a/xt/extra/diagnostics/unresolvable_relationship.t b/xt/extra/diagnostics/unresolvable_relationship.t index 5a53cd9..23a4d88 100644 --- a/xt/extra/diagnostics/unresolvable_relationship.t +++ b/xt/extra/diagnostics/unresolvable_relationship.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/xt/extra/internals/dbictest_unlink_guard.t b/xt/extra/internals/dbictest_unlink_guard.t index 83a38e9..9ab5c1b 100644 --- a/xt/extra/internals/dbictest_unlink_guard.t +++ b/xt/extra/internals/dbictest_unlink_guard.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use warnings; use strict; use Test::More; -use lib 't/lib'; + use DBICTest; # Once upon a time there was a problem with a leaking $sth diff --git a/xt/extra/internals/discard_changes_in_DESTROY.t b/xt/extra/internals/discard_changes_in_DESTROY.t index 736664d..a5fa8e0 100644 --- a/xt/extra/internals/discard_changes_in_DESTROY.t +++ b/xt/extra/internals/discard_changes_in_DESTROY.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/xt/extra/internals/ensure_class_loaded.t b/xt/extra/internals/ensure_class_loaded.t index e933c00..3dba83d 100644 --- a/xt/extra/internals/ensure_class_loaded.t +++ b/xt/extra/internals/ensure_class_loaded.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; use DBIx::Class::_Util 'sigwarn_silencer'; use Class::Inspector; diff --git a/xt/extra/internals/merge_joinpref_attr.t b/xt/extra/internals/merge_joinpref_attr.t index bb77358..7a242bd 100644 --- a/xt/extra/internals/merge_joinpref_attr.t +++ b/xt/extra/internals/merge_joinpref_attr.t @@ -1,8 +1,10 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use lib qw(t/lib); + use DBICTest; use Test::More; diff --git a/xt/extra/internals/namespaces_cleaned.t b/xt/extra/internals/namespaces_cleaned.t index 552a81e..b8b42b7 100644 --- a/xt/extra/internals/namespaces_cleaned.t +++ b/xt/extra/internals/namespaces_cleaned.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + BEGIN { if ( "$]" < 5.010) { @@ -16,7 +18,7 @@ BEGIN { # we want to do this here, in the very beginning, before even # warnings/strict are loaded - unshift @INC, 't/lib'; + require DBICTest::Util::OverrideRequire; DBICTest::Util::OverrideRequire::override_global_require( sub { @@ -35,8 +37,6 @@ use warnings; use Test::More; -use lib 't/lib'; - use DBICTest; use File::Find; use File::Spec; diff --git a/xt/extra/lean_startup.t b/xt/extra/lean_startup.t index 2a5c8d5..af1f3e8 100644 --- a/xt/extra/lean_startup.t +++ b/xt/extra/lean_startup.t @@ -1,3 +1,5 @@ +BEGIN { $ENV{DBICTEST_ANFANG_DEFANG} = 1 } + # Use a require override instead of @INC munging (less common) # Do the override as early as possible so that CORE::require doesn't get compiled away diff --git a/xt/extra/multicreate_opcount.t b/xt/extra/multicreate_opcount.t index 4184f06..06369d9 100644 --- a/xt/extra/multicreate_opcount.t +++ b/xt/extra/multicreate_opcount.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -7,7 +9,7 @@ BEGIN { } use Test::Exception; -use lib qw(t/lib); + use DBICTest; my $schema = DBICTest->init_schema(); diff --git a/xt/extra/sqlite_deadlock.t b/xt/extra/sqlite_deadlock.t index a9fdca9..f50175e 100644 --- a/xt/extra/sqlite_deadlock.t +++ b/xt/extra/sqlite_deadlock.t @@ -1,3 +1,5 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; @@ -5,7 +7,7 @@ use Test::More; use Test::Exception; use File::Temp (); -use lib 't/lib'; + use DBICTest; plan tests => 2; diff --git a/xt/extra/sqlite_view_deps.t b/xt/extra/sqlite_view_deps.t index 39bb632..3aabe15 100644 --- a/xt/extra/sqlite_view_deps.t +++ b/xt/extra/sqlite_view_deps.t @@ -1,3 +1,4 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use DBIx::Class::Optional::Dependencies -skip_all_without => 'deploy'; use strict; @@ -6,7 +7,7 @@ use warnings; use Test::More; use Test::Exception; use Test::Warn; -use lib qw(t/lib); + use DBICTest; use ViewDeps; use ViewDepsBad;