blib/lib/Dist/Zilla/App/Command/test.pm

filter: Statementstmt 46.6% 7 / 15 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 40.0% 2 / 5 Podpod 100% 3 / 3 totaltotal 21.0% 12 / 57 CC 12 SCAR 47.7
CC
12
Cov
17%
execute
156.0
opt_spec
2.0
abstract
2.0
CRAP 117.4
↑ Summary blib/lib/Dist/Zilla/App/Command/setup.pm »
1 package Dist::Zilla::App::Command::test 6.040;
2 # ABSTRACT: test your dist
3  
4 4 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 ▶use Dist::Zilla::App -command;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 #pod =head1 SYNOPSIS
9 #pod
10 #pod dzil test [ --release ] [ --no-author ] [ --automated ] [ --extended ] [ --all ]
11 #pod
12 #pod =head1 DESCRIPTION
13 #pod
14 #pod This command is a thin wrapper around the L<test|Dist::Zilla::Dist::Builder/test> method in
15 #pod Dist::Zilla. It builds your dist and runs the tests with the AUTHOR_TESTING
16 #pod environment variable turned on, so it's like doing this:
17 #pod
18 #pod export AUTHOR_TESTING=1
19 #pod dzil build --no-tgz
20 #pod cd $BUILD_DIRECTORY
21 #pod perl Makefile.PL
22 #pod make
23 #pod make test
24 #pod
25 #pod A build that fails tests will be left behind for analysis, and F<dzil> will
26 #pod exit a non-zero value. If the tests are successful, the build directory will
27 #pod be removed and F<dzil> will exit with status 0.
28 #pod
29 #pod =cut
30  
31 0 ▶sub opt_spec {
Subroutine opt_spec: not called CC=1 SCAR=6.9
Pod documented
32 0 [ 'release' => 'enables the RELEASE_TESTING env variable', { default => 0 } ],
33 [ 'automated' => 'enables the AUTOMATED_TESTING env variable', { default => 0 } ],
34 [ 'extended' => 'enables the EXTENDED_TESTING env variable', { default => 0 } ],
35 [ 'author!' => 'enables the AUTHOR_TESTING env variable (default behavior)', { default => 1 } ],
36 [ 'all' => 'enables the RELEASE_TESTING, AUTOMATED_TESTING, EXTENDED_TESTING and AUTHOR_TESTING env variables', { default => 0 } ],
37 [ 'keep-build-dir|keep' => 'keep the build directory even after a success' ],
38 [ 'jobs|j=i' => 'number of parallel test jobs to run' ],
39 [ 'test-verbose' => 'enables verbose testing (TEST_VERBOSE env variable on Makefile.PL, --verbose on Build.PL', { default => 0 } ],
40 }
41  
42 #pod =head1 OPTIONS
43 #pod
44 #pod =head2 --release
45 #pod
46 #pod This will run the test suite with RELEASE_TESTING=1
47 #pod
48 #pod =head2 --automated
49 #pod
50 #pod This will run the test suite with AUTOMATED_TESTING=1
51 #pod
52 #pod =head2 --extended
53 #pod
54 #pod This will run the test suite with EXTENDED_TESTING=1
55 #pod
56 #pod =head2 --no-author
57 #pod
58 #pod This will run the test suite without setting AUTHOR_TESTING
59 #pod
60 #pod =head2 --all
61 #pod
62 #pod Equivalent to --release --automated --extended --author
63 #pod
64 #pod =cut
65  
66 0 ▶sub abstract { 'test your dist' }
Subroutine abstract: not called CC=1 SCAR=6.9
Pod documented
67  
68 0 ▶sub execute {
Subroutine execute: not called CC=12 SCAR=50.5
Pod documented
69 0 my ($self, $opt, $arg) = @_;
70  
71 0 ▶ local $ENV{RELEASE_TESTING} = 1 if $opt->release or $opt->all;
Branch: 1 branch
BranchTrueFalseTotal
if $opt->release or $opt->all 0 0 0
Condition0%0/3
$opt->release or $opt->all
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt->release or $opt->all
$opt->release $opt->all
Truth table0%0/3
A or B
A= $opt->releaseB= $opt->all
ABresult
1X1
011
000
72 0 ▶ local $ENV{AUTHOR_TESTING} = 1 if $opt->author or $opt->all;
Branch: 1 branch
BranchTrueFalseTotal
if $opt->author or $opt->all 0 0 0
Condition0%0/3
$opt->author or $opt->all
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt->author or $opt->all
$opt->author $opt->all
Truth table0%0/3
A or B
A= $opt->authorB= $opt->all
ABresult
1X1
011
000
73 0 ▶ local $ENV{AUTOMATED_TESTING} = 1 if $opt->automated or $opt->all;
Branch: 1 branch
BranchTrueFalseTotal
if $opt->automated or $opt->all 0 0 0
Condition0%0/3
$opt->automated or $opt->all
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt->automated or $opt->all
$opt->automated $opt->all
Truth table0%0/3
A or B
A= $opt->automatedB= $opt->all
ABresult
1X1
011
000
74 0 ▶ local $ENV{EXTENDED_TESTING} = 1 if $opt->extended or $opt->all;
Branch: 1 branch
BranchTrueFalseTotal
if $opt->extended or $opt->all 0 0 0
Condition0%0/3
$opt->extended or $opt->all
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt->extended or $opt->all
$opt->extended $opt->all
Truth table0%0/3
A or B
A= $opt->extendedB= $opt->all
ABresult
1X1
011
000
75  
76 0 ▶ $self->zilla->test({
Branch: 3 branches
BranchTrueFalseTotal
$opt->keep_build_dir ? : 0 0 0
$opt->jobs ? : 0 0 0
$opt->test_verbose ? : 0 0 0
77 $opt->keep_build_dir
78 ? (keep_build_dir => 1)
79 : (),
80 $opt->jobs
81 ? (jobs => $opt->jobs)
82 : (),
83 $opt->test_verbose
84 ? (test_verbose => $opt->test_verbose)
85 : (),
86 });
87 }
88  
89 4 1;
90  
91 __END__
↑ Summary blib/lib/Dist/Zilla/App/Command/setup.pm »