Move tmpdir() to DBICTest::Util where it belongs
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / RunMode.pm
1 package # hide from PAUSE
2     DBICTest::RunMode;
3
4 use strict;
5 use warnings;
6
7 # Mimic $Module::Install::AUTHOR
8 sub is_author {
9   return (
10     ! -d 'inc/Module'
11       or
12     -e 'inc/.author'
13   );
14 }
15
16 sub is_smoker {
17   return (
18     ( $ENV{AUTOMATED_TESTING} && ! $ENV{PERL5_CPANM_IS_RUNNING} && ! $ENV{RELEASE_TESTING} )
19       or
20     __PACKAGE__->is_ci
21   );
22 }
23
24 sub is_ci {
25   return (
26     ($ENV{TRAVIS}||'') eq 'true'
27       and
28     ($ENV{TRAVIS_REPO_SLUG}||'') =~ m|\w+/dbix-class$|
29   )
30 }
31
32 sub is_plain {
33   return (
34     ! $ENV{RELEASE_TESTING}
35       and
36     ! $ENV{DBICTEST_RUN_ALL_TESTS}
37       and
38     ! __PACKAGE__->is_smoker
39       and
40     ! __PACKAGE__->is_author
41   )
42 }
43
44 1;