X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest.pm;h=8988db99f661c1cff801c04383a4ab205ef96341;hb=5e7249645ea75d5a9d25f1fdf8a42e0536b03f4e;hp=a18576361b7a4e160f0073e738cba94b18a36c02;hpb=a5f2ccb49689cf2603ea5614b231088cb520734f;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index a185763..8988db9 100644 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -18,6 +18,25 @@ BEGIN { } } +use Module::Runtime 'module_notional_filename'; +BEGIN { + for my $mod (qw( DBIC::SqlMakerTest SQL::Abstract )) { + if ( $INC{ module_notional_filename($mod) } ) { + # FIXME this does not seem to work in BEGIN - why?! + #require Carp; + #$Carp::Internal{ (__PACKAGE__) }++; + #Carp::croak( __PACKAGE__ . " must be loaded before $mod" ); + + my ($fr, @frame) = 1; + while (@frame = caller($fr++)) { + last if $frame[1] !~ m|^t/lib/DBICTest|; + } + + die __PACKAGE__ . " must be loaded before $mod (or modules using $mod) at $frame[1] line $frame[2]\n"; + } + } +} + use DBICTest::RunMode; use DBICTest::Schema; use DBICTest::Util::LeakTracer qw/populate_weakregistry assert_empty_weakregistry/;