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