X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDBICTest%2FRunMode.pm;h=fb3680587c09f759bbaf471e8d8cb12cd9a6deb3;hb=6853e2c32de07a3cec73855597ccc8b863cd4d54;hp=39661a12cd1bf344d089c1adfaf4a90b43b9a01e;hpb=81b29c8d4a021dd3288ab68117198e5255f9d760;p=dbsrgits%2FDBIx-Class.git diff --git a/t/lib/DBICTest/RunMode.pm b/t/lib/DBICTest/RunMode.pm index 39661a1..fb36805 100644 --- a/t/lib/DBICTest/RunMode.pm +++ b/t/lib/DBICTest/RunMode.pm @@ -13,6 +13,18 @@ BEGIN { 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; + }; + } } use Path::Class qw/file dir/; @@ -197,23 +209,31 @@ sub is_author { } sub is_smoker { - return - __PACKAGE__->is_ci - || + return ( ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} ) - ; + or + __PACKAGE__->is_ci + ); } sub is_ci { return ( ($ENV{TRAVIS}||'') eq 'true' and - ($ENV{TRAVIS_REPO_SLUG}||'') eq 'dbsrgits/dbix-class' + ($ENV{TRAVIS_REPO_SLUG}||'') =~ m|\w+/dbix-class$| ) } sub is_plain { - return (! __PACKAGE__->is_smoker && ! __PACKAGE__->is_author && ! $ENV{RELEASE_TESTING} ) + return ( + ! $ENV{RELEASE_TESTING} + and + ! $ENV{DBICTEST_RUN_ALL_TESTS} + and + ! __PACKAGE__->is_smoker + and + ! __PACKAGE__->is_author + ) } # Try to determine the root of a checkout/untar if possible