File Coverage

blib/lib/Test/Apocalypse/Script.pm
Criterion Covered Total %
statement 25 26 96.1
branch 3 4 75.0
condition n/a
subroutine 8 8 100.0
pod 0 1 0.0
total 36 39 92.3


line stmt bran cond sub pod time code
1             #
2             # This file is part of Test-Apocalypse
3             #
4             # This software is copyright (c) 2014 by Apocalypse.
5             #
6             # This is free software; you can redistribute it and/or modify it under
7             # the same terms as the Perl 5 programming language system itself.
8             #
9 38     38   10668895 use strict; use warnings;
  38     38   87  
  38         2419  
  38         191  
  38         38  
  38         1656  
10             package Test::Apocalypse::Script;
11             $Test::Apocalypse::Script::VERSION = '1.006';
12             BEGIN {
13 38     38   500 $Test::Apocalypse::Script::AUTHORITY = 'cpan:APOCAL';
14             }
15              
16             # ABSTRACT: Plugin for Test::Script
17              
18 38     38   157 use Test::More;
  38         38  
  38         403  
19 38     38   25774 use Test::Script 1.07;
  38         125308  
  38         155  
20 38     38   8054 use File::Find::Rule 0.32;
  38         8174  
  38         265  
21              
22             # TODO we need to search more locations/extensions/etc?
23             my @files;
24             sub _is_disabled {
25             # TODO Stupid FFR complains if the dir doesn't exist?!?
26 37     37   37 my @dirs;
27 37         148 foreach my $d ( qw( examples bin scripts ) ) {
28 111 100       1813 push @dirs, $d if -d $d;
29             }
30 37         1184 @files = File::Find::Rule->file->name( qr/\.pl$/ )->in( @dirs );
31              
32             # Skip if no scripts
33 37 50       24901 if ( ! scalar @files ) {
34 0         0 return 'No script files found in the distribution';
35             }
36             }
37              
38             sub do_test {
39 37     37 0 185 plan tests => scalar @files;
40 37         6290 foreach my $f ( @files ) {
41 37         296 script_compiles( $f );
42             }
43              
44 37         1653308 return;
45             }
46              
47             1;
48              
49             __END__
50              
51             =pod
52              
53             =encoding UTF-8
54              
55             =for :stopwords Apocalypse Niebur Ryan
56              
57             =for Pod::Coverage do_test
58              
59             =head1 NAME
60              
61             Test::Apocalypse::Script - Plugin for Test::Script
62              
63             =head1 VERSION
64              
65             This document describes v1.006 of Test::Apocalypse::Script - released October 25, 2014 as part of Test-Apocalypse.
66              
67             =head1 DESCRIPTION
68              
69             Encapsulates L<Test::Script> functionality.
70              
71             =head1 SEE ALSO
72              
73             Please see those modules/websites for more information related to this module.
74              
75             =over 4
76              
77             =item *
78              
79             L<Test::Apocalypse|Test::Apocalypse>
80              
81             =back
82              
83             =head1 AUTHOR
84              
85             Apocalypse <APOCAL@cpan.org>
86              
87             =head1 COPYRIGHT AND LICENSE
88              
89             This software is copyright (c) 2014 by Apocalypse.
90              
91             This is free software; you can redistribute it and/or modify it under
92             the same terms as the Perl 5 programming language system itself.
93              
94             The full text of the license can be found in the
95             F<LICENSE> file included with this distribution.
96              
97             =head1 DISCLAIMER OF WARRANTY
98              
99             THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
100             APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
101             HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
102             OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
103             THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
104             PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
105             IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
106             ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
107              
108             IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
109             WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
110             THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
111             GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
112             USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
113             DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
114             PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
115             EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
116             SUCH DAMAGES.
117              
118             =cut