CHI/Test/Class.pm

filter: Statementstmt 100% 25 / 25 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 50.0% 1 / 2 totaltotal 95.0% 38 / 40 CC 4 SCAR 7.9
CC
4
Cov
97%
runtests
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
« CHI/t/Subcache.pm ↑ Summary CHI/Driver/Memory.pm »
1 package CHI::Test::Class;
2 19 $CHI::Test::Class::VERSION = '0.60';
3 19 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 19 ▶use CHI::Util qw(can_load);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 19 ▶use base qw(Test::Class);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub runtests {
10 19 ▶ my ($class) = @_;
Subroutine runtests: called CC=4 SCAR=13.9
Pod documented
11  
12 # Check for required modules
13 #
14 19 ▶ if ( my $required_modules = $class->required_modules ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $required_modules = $class->required_modules) 19 0 19
15 19 ▶ while ( my ( $key, $value ) = each(%$required_modules) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$required_modules) 3 18 21
16 3 ▶ unless ( can_load($key) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (can_load($key)) 1 2 3
17 1 $class->SKIP_ALL("one of required modules not installed: $key");
18 }
19 }
20 }
21  
22 # Only run tests directly in $class.
23 #
24 18 my $test_obj = $class->new();
25 18 Test::Class::runtests($test_obj);
26 }
27  
28 sub required_modules {
29 17 ▶ return {};
Subroutine required_modules: called CC=1 SCAR=0.0
Pod undocumented
30 }
31  
32 19 1;
« CHI/t/Subcache.pm ↑ Summary CHI/Driver/Memory.pm »