use strict;
use warnings;
-use DBICTest::AuthorCheck;
+use DBICTest::RunMode;
use DBICTest::Schema;
use Carp;
package # hide from PAUSE
- DBICTest::AuthorCheck;
+ DBICTest::RunMode;
use strict;
use warnings;
return (
( not -d $root->subdir ('inc') )
or
- ( -e $root->subdir ('inc')->file ($^O eq 'VMS' ? '_author' : '.author') )
+ ( -e $root->subdir ('inc')->subdir ($^O eq 'VMS' ? '_author' : '.author') )
);
}
+sub is_smoker {
+ return ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )
+}
+
+sub is_plain {
+ return (! __PACKAGE__->is_smoker && ! __PACKAGE__->is_author && ! $ENV{RELEASE_TESTING} )
+}
+
# Try to determine the root of a checkout/untar if possible
# or return undef
sub _find_co_root {
'Skipping RH perl performance bug tests as DBIC_NO_WARN_BAD_PERL set'
if ( $ENV{DBIC_NO_WARN_BAD_PERL} );
-plan skip_all => 'Skipping as AUTOMATED_TESTING is set'
- if ( $ENV{AUTOMATED_TESTING} );
+plan skip_all => 'Skipping as system appears to be a smoker'
+ if DBICTest::RunMode->is_smoker;
plan tests => 3;
use DBICTest;
use DBICTest::Schema;
-unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) {
+if ( DBICTest::RunMode->is_plain ) {
plan( skip_all => "Skipping test on plain module install" );
}
plan tests => 2;
-my $wait_for = 30; # how many seconds to wait
+my $wait_for = 120; # how many seconds to wait
for my $close (0,1) {
use DBICTest;
# Don't run tests for installs
-unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) {
+if ( DBICTest::RunMode->is_plain ) {
plan( skip_all => "Author tests not required for installation" );
}
require DBIx::Class;
unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_eol') ) {
my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_eol');
- $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author
+ (! DBICTest::RunMode->is_plain && ! DBICTest::RunMode->is_smoker )
? die ("Failed to load release-testing module requirements: $missing")
: plan skip_all => "Test needs: $missing"
}
local $TODO = 'Do not fix those yet - we have way too many branches out there, merging will be hell';
Test::EOL::all_perl_files_ok({ trailing_whitespace => 1},
qw/t xt lib script/,
- DBICTest::AuthorCheck->is_author ? ('maint') : (),
+ DBICTest::RunMode->is_author ? ('maint') : (),
);
}
use DBICTest;
# Don't run tests for installs
-unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) {
+if ( DBICTest::RunMode->is_plain ) {
plan( skip_all => "Author tests not required for installation" );
}
require DBIx::Class;
unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_notabs') ) {
my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_notabs');
- $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author
+ (! DBICTest::RunMode->is_plain && ! DBICTest::RunMode->is_smoker )
? die ("Failed to load release-testing module requirements: $missing")
: plan skip_all => "Test needs: $missing"
}
Test::NoTabs::all_perl_files_ok(
qw/t xt lib script/,
- DBICTest::AuthorCheck->is_author ? ('maint') : (),
+ DBICTest::RunMode->is_author ? ('maint') : (),
);
# FIXME - need to fix Test::NoTabs - doesn't work with done_testing
use DBICTest;
# Don't run tests for installs
-unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) {
+if ( DBICTest::RunMode->is_plain ) {
plan( skip_all => "Author tests not required for installation" );
}
require DBIx::Class;
unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_pod') ) {
my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_pod');
- $ENV{RELEASE_TESTING} || DBICTest::AuthorCheck->is_author
+ (! DBICTest::RunMode->is_plain && ! DBICTest::RunMode->is_smoker )
? die ("Failed to load release-testing module requirements: $missing")
: plan skip_all => "Test needs: $missing"
}
use namespace::clean;
# Don't run tests for installs
-unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) {
+if ( DBICTest::RunMode->is_plain ) {
plan( skip_all => "Author tests not required for installation" );
}