Apocalypse/Script.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 92.8% 39 / 42 CC 5 SCAR 7.9
CC
5
Cov
94%
_is_disabled
4.1
do_test
2.0
BEGIN
1.0
CRAP 2.2
« Apocalypse/FileChecks.pm ↑ Summary Apocalypse/Signature.pm »
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 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
10 package Test::Apocalypse::Script;
11 38 $Test::Apocalypse::Script::VERSION = '1.006';
12 38 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
13 38 $Test::Apocalypse::Script::AUTHORITY = 'cpan:APOCAL';
14 }
15  
16 # ABSTRACT: Plugin for Test::Script
17  
18 38 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 38 ▶use Test::Script 1.07;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 38 ▶use File::Find::Rule 0.32;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 # TODO we need to search more locations/extensions/etc?
23 38 my @files;
24 37 ▶sub _is_disabled {
Subroutine _is_disabled: called CC=4 SCAR=14.2
25 # TODO Stupid FFR complains if the dir doesn't exist?!?
26 37 my @dirs;
27 37 foreach my $d ( qw( examples bin scripts ) ) {
28 111 ▶ push @dirs, $d if -d $d;
Branch: 1 branch
BranchTrueFalseTotal
if -d $d 37 74 111
29 }
30 37 @files = File::Find::Rule->file->name( qr/\.pl$/ )->in( @dirs );
31  
32 # Skip if no scripts
33 37 ▶ if ( ! scalar @files ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not scalar @files) 0 37 37
34 0 return 'No script files found in the distribution';
35 }
36 }
37  
38 37 ▶sub do_test {
Subroutine do_test: called CC=2 SCAR=6.9
Pod undocumented
39 37 plan tests => scalar @files;
40 37 foreach my $f ( @files ) {
41 37 script_compiles( $f );
42 }
43  
44 37 return;
45 }
46  
47 38 1;
48  
49 __END__
« Apocalypse/FileChecks.pm ↑ Summary Apocalypse/Signature.pm »