lib/WWW/Selenium/Util.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 1 / 2 Conditioncond 40.0% 4 / 10 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 73.8% 31 / 42 CC 6 SCAR 17.6
CC
6
Cov
78%
server_is_running
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.8
« lib/Test/WWW/Selenium.pm ↑ Summary lib/WWW/Selenium.pm »
1 package WWW::Selenium::Util;
2 {
3 4 $WWW::Selenium::Util::VERSION = '1.36';
4 }
5 # ABSTRACT: Utility code to help test using Selenium
6  
7 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 ▶use IO::Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 our @EXPORT_OK = qw(server_is_running);
12  
13  
14 3 ▶sub server_is_running {
Subroutine server_is_running: called CC=6 SCAR=22.0
Pod documented
15 3 ▶ my $host = $ENV{SRC_HOST} || shift || 'localhost';
Condition40%2/5
$ENV{'SRC_HOST'} || shift() || 'localhost'
l!l
03
$ENV{"SRC_HOST"} or shift()
l!l&&r!l&&!r
003
MC/DC0%0/2
$ENV{'SRC_HOST'} || shift() || 'localhost'
$ENV{"SRC_HOST"} shift()
Truth table33%1/3
A or B
A= $ENV{"SRC_HOST"}B= shift()
ABresult
1X1
011
000
16 3 ▶ my $port = $ENV{SRC_PORT} || shift || 4444;
Condition40%2/5
$ENV{'SRC_PORT'} || shift() || 4444
l!l
03
$ENV{"SRC_PORT"} or shift()
l!l&&r!l&&!r
003
MC/DC0%0/2
$ENV{'SRC_PORT'} || shift() || 4444
$ENV{"SRC_PORT"} shift()
Truth table33%1/3
A or B
A= $ENV{"SRC_PORT"}B= shift()
ABresult
1X1
011
000
17  
18 3 ▶ return ($host, $port) if IO::Socket::INET->new(
Branch: 1 branch
BranchTrueFalseTotal
if "IO::Socket::INET"->new("PeerAddr", $host, "PeerPort", $port) 0 3 3
19 PeerAddr => $host,
20 PeerPort => $port,
21 );
22 3 return;
23  
24 }
25  
26 4 1;
27  
28 __END__
« lib/Test/WWW/Selenium.pm ↑ Summary lib/WWW/Selenium.pm »