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 SCAR 13.9
CC
4
Cov
97%
runtests
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 4.0
« CHI/t/Driver/RawMemory.pm ↑ Summary CHI/t/Subcache.pm »
1 package CHI::Test::Class;
2 20 $CHI::Test::Class::VERSION = '0.59';
3 20 ▶use Getopt::Long;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 ▶use CHI::Util qw(can_load);
Subroutine BEGIN: called CC=1 SCAR=0.0
5 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 20 ▶use base qw(Test::Class);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub runtests {
10 20 ▶ my ($class) = @_;
Subroutine runtests: called CC=4 SCAR=13.9
Pod documented
11  
12 # Check for required modules
13 #
14 20 ▶ if ( my $required_modules = $class->required_modules ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $required_modules = $class->required_modules) 20 0 20
15 20 ▶ while ( my ( $key, $value ) = each(%$required_modules) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$required_modules) 3 19 22
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 19 my $test_obj = $class->new();
25 19 Test::Class::runtests($test_obj);
26 }
27  
28 sub required_modules {
29 18 ▶ return {};
Subroutine required_modules: called CC=1 SCAR=0.0
Pod undocumented
30 }
31  
32 20 1;
« CHI/t/Driver/RawMemory.pm ↑ Summary CHI/t/Subcache.pm »