File Coverage

blib/lib/Dist/Zilla/App/Command/smoke.pm
Criterion Covered Total %
statement 6 13 46.1
branch 0 6 0.0
condition n/a
subroutine 2 5 40.0
pod 3 3 100.0
total 11 27 40.7


line stmt bran cond sub pod time code
1             # ABSTRACT: smoke your dist
2              
3             use Dist::Zilla::Pragmas;
4 4     4   3085  
  4         13  
  4         33  
5             use Dist::Zilla::App -command;
6 4     4   27  
  4         17  
  4         39  
7             #pod =head1 SYNOPSIS
8             #pod
9             #pod dzil smoke [ --release ] [ --author ] [ --no-automated ]
10             #pod
11             #pod =head1 DESCRIPTION
12             #pod
13             #pod This command builds and tests the distribution in "smoke testing mode."
14             #pod
15             #pod This command is a thin wrapper around the L<test|Dist::Zilla::Dist::Builder/test> method in
16             #pod Dist::Zilla. It builds your dist and runs the tests with the AUTOMATED_TESTING
17             #pod environment variable turned on, so it's like doing this:
18             #pod
19             #pod export AUTOMATED_TESTING=1
20             #pod dzil build --no-tgz
21             #pod cd $BUILD_DIRECTORY
22             #pod perl Makefile.PL
23             #pod make
24             #pod make test
25             #pod
26             #pod A build that fails tests will be left behind for analysis, and F<dzil> will
27             #pod exit a non-zero value. If the tests are successful, the build directory will
28             #pod be removed and F<dzil> will exit with status 0.
29             #pod
30             #pod =cut
31              
32             [ 'release' => 'enables the RELEASE_TESTING env variable', { default => 0 } ],
33             [ 'automated!' => 'enables the AUTOMATED_TESTING env variable (default behavior)', { default => 1 } ],
34 0     0 1   [ 'author' => 'enables the AUTHOR_TESTING env variable', { default => 0 } ]
35             }
36              
37             #pod =head1 OPTIONS
38             #pod
39             #pod =head2 --release
40             #pod
41             #pod This will run the test suite with RELEASE_TESTING=1
42             #pod
43             #pod =head2 --no-automated
44             #pod
45             #pod This will run the test suite without setting AUTOMATED_TESTING
46             #pod
47             #pod =head2 --author
48             #pod
49             #pod This will run the test suite with AUTHOR_TESTING=1
50             #pod
51             #pod =cut
52              
53              
54             my ($self, $opt, $arg) = @_;
55 0     0 1    
56             local $ENV{RELEASE_TESTING} = 1 if $opt->release;
57             local $ENV{AUTHOR_TESTING} = 1 if $opt->author;
58 0     0 1   local $ENV{AUTOMATED_TESTING} = 1 if $opt->automated;
59              
60 0 0         $self->zilla->test;
61 0 0         }
62 0 0          
63             1;
64 0            
65              
66             =pod
67              
68             =encoding UTF-8
69              
70             =head1 NAME
71              
72             Dist::Zilla::App::Command::smoke - smoke your dist
73              
74             =head1 VERSION
75              
76             version 6.028
77              
78             =head1 SYNOPSIS
79              
80             dzil smoke [ --release ] [ --author ] [ --no-automated ]
81              
82             =head1 DESCRIPTION
83              
84             This command builds and tests the distribution in "smoke testing mode."
85              
86             This command is a thin wrapper around the L<test|Dist::Zilla::Dist::Builder/test> method in
87             Dist::Zilla. It builds your dist and runs the tests with the AUTOMATED_TESTING
88             environment variable turned on, so it's like doing this:
89              
90             export AUTOMATED_TESTING=1
91             dzil build --no-tgz
92             cd $BUILD_DIRECTORY
93             perl Makefile.PL
94             make
95             make test
96              
97             A build that fails tests will be left behind for analysis, and F<dzil> will
98             exit a non-zero value. If the tests are successful, the build directory will
99             be removed and F<dzil> will exit with status 0.
100              
101             =head1 PERL VERSION
102              
103             This module should work on any version of perl still receiving updates from
104             the Perl 5 Porters. This means it should work on any version of perl released
105             in the last two to three years. (That is, if the most recently released
106             version is v5.40, then this module should work on both v5.40 and v5.38.)
107              
108             Although it may work on older versions of perl, no guarantee is made that the
109             minimum required version will not be increased. The version may be increased
110             for any reason, and there is no promise that patches will be accepted to lower
111             the minimum required perl.
112              
113             =head1 OPTIONS
114              
115             =head2 --release
116              
117             This will run the test suite with RELEASE_TESTING=1
118              
119             =head2 --no-automated
120              
121             This will run the test suite without setting AUTOMATED_TESTING
122              
123             =head2 --author
124              
125             This will run the test suite with AUTHOR_TESTING=1
126              
127             =head1 AUTHOR
128              
129             Ricardo SIGNES 😏 <cpan@semiotic.systems>
130              
131             =head1 COPYRIGHT AND LICENSE
132              
133             This software is copyright (c) 2022 by Ricardo SIGNES.
134              
135             This is free software; you can redistribute it and/or modify it under
136             the same terms as the Perl 5 programming language system itself.
137              
138             =cut