File Coverage

inc/WWW/Wookie/Module/Build/Standard.pm
Criterion Covered Total %
statement 20 43 46.5
branch 1 6 16.6
condition n/a
subroutine 7 13 53.8
pod 1 6 16.6
total 29 68 42.6


line stmt bran cond sub pod time code
1             # -*- cperl; cperl-indent-level: 4 -*-
2             ## no critic (RequirePodSections)
3             package WWW::Wookie::Module::Build::Standard v1.1.4;
4              
5 1     1   694 use 5.016000;
  1         4  
6              
7 1     1   7 use strict;
  1         1  
  1         38  
8 1     1   6 use warnings;
  1         1  
  1         48  
9              
10 1     1   5 use Carp;
  1         2  
  1         88  
11 1     1   6 use English qw($OS_ERROR -no_match_vars);
  1         1  
  1         6  
12 1     1   179 use parent 'Module::Build';
  1         2  
  1         7  
13              
14             ## no critic (Capitalization)
15             sub ACTION_authortest {
16             ## use critic
17 0     0 0 0 my ($self) = @_;
18 0         0 $self->authortest_dependencies();
19 0         0 $self->depends_on('test');
20 0         0 return;
21             }
22              
23             ## no critic (Capitalization)
24             sub ACTION_authortestcover {
25             ## use critic
26 0     0 0 0 my ($self) = @_;
27 0         0 $self->authortest_dependencies();
28 0         0 $self->depends_on('testcover');
29 0         0 return;
30             }
31              
32             ## no critic (Capitalization)
33             sub ACTION_distdir {
34             ## use critic
35 0     0 0 0 my ( $self, @arguments ) = @_;
36 0         0 $self->depends_on('authortest');
37 0         0 return $self->SUPER::ACTION_distdir(@arguments);
38             }
39              
40             ## no critic (Capitalization)
41             sub ACTION_manifest {
42             ## use critic
43 0     0 0 0 my ( $self, @arguments ) = @_;
44 0 0       0 if ( -e 'MANIFEST' ) {
45 0 0       0 unlink 'MANIFEST' or Carp::croak qq{Can't unlink MANIFEST: $OS_ERROR};
46             }
47 0         0 return $self->SUPER::ACTION_manifest(@arguments);
48             }
49              
50             sub tap_harness_args {
51 1     1 0 8867 my ($self) = @_;
52 1 50       14 if ( $ENV{'RUNNING_UNDER_TEAMCITY'} ) {
53 0         0 return $self->_tap_harness_args();
54             }
55 1         4 return;
56             }
57              
58             sub _tap_harness_args {
59 0     0     return { 'formatter_class' => 'TAP::Formatter::TeamCity', 'merge' => 1 };
60             }
61              
62             sub authortest_dependencies {
63 0     0 1   my ($self) = @_;
64 0           $self->depends_on('build');
65 0           $self->test_files(qw< t xt >);
66             ## no critic (RequireLocalizedPunctuationVars)
67 0           $ENV{'AUTHOR_TESTING'} = 1;
68             ## use critic
69 0           $self->recursive_test_files(1);
70 0           return;
71             }
72              
73             1;
74              
75             __END__
76              
77             =pod
78              
79             =for stopwords authortest authortestcover distdir Ipenburg
80              
81             =head1 NAME
82              
83             WWW::Wookie::Module::Build::Standard - Customization of L<Module::Build> for
84             L<WWW::Wookie> distributions.
85              
86             =head1 DESCRIPTION
87              
88             This is a custom subclass of L<Module::Build> that enhances existing
89             functionality and adds more for the benefit of installing and developing
90             L<WWW::Wookie>. The following actions have been added or redefined:
91              
92             =head1 ACTIONS
93              
94             =over
95              
96             =item authortest
97              
98             Runs the regular tests plus the author tests (those in F<xt>). You've got to
99             explicitly ask for the author tests to be run.
100              
101             =item authortestcover
102              
103             As C<authortest> is to the standard C<test> action, C<authortestcover>
104             is to the standard C<testcover> action.
105              
106             =item distdir
107              
108             In addition to the standard action, this adds a dependency upon the
109             C<authortest> action so you can't do a release without passing the
110             author tests.
111              
112             =back
113              
114             =head1 METHODS
115              
116             In addition to the above actions:
117              
118             =head2 C<authortest_dependencies()>
119              
120             Sets up dependencies upon the C<build>, C<manifest>, and C<distmeta> actions,
121             adds F<xt> to the set of test directories, and turns on the recursive
122             search for tests.
123              
124             =head1 AUTHOR
125              
126             Roland van Ipenburg <roland@rolandvanipenburg.com>, based on the work of Elliot
127             Shank <perl@galumph.com> in L<Perl::Critic>.
128              
129             =head1 COPYRIGHT
130              
131             Copyright (c) 2024 Roland van Ipenburg.
132              
133             This program is free software; you can redistribute it and/or modify
134             it under the same terms as Perl itself. The full text of this license
135             can be found in the LICENSE file included with this module.
136              
137             =cut