tfiles/service/slow-service

filter: Statementstmt 85.7% 12 / 14 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod n/a totaltotal 82.6% 19 / 23 SCAR 7.0
CC
2
Cov
88%
stop_impl
2.0
status_impl
2.0
check_timeout
2.0
CRAP 2.0
« lib/Ubic/Result.pm ↑ Summary blib/lib/Ubic/Credentials/OS/Windows.pm »
1 # vim: ft=perl
2  
3 91 ▶use parent qw(Ubic::Service::Skeleton);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 91 ▶use Ubic::Daemon qw(:all);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 my $pidfile = 'tfiles/slow.pid';
7  
8 sub new {
9 91 ▶ return bless {} => shift;
Subroutine new: called CC=1 SCAR=0.0
10 }
11  
12 sub start_impl {
13 3 ▶ start_daemon({
Subroutine start_impl: called CC=1 SCAR=0.0
14 bin => 'sleep 1000',
15 pidfile => $pidfile,
16 });
17 }
18  
19 sub stop_impl {
20 0 ▶ stop_daemon($pidfile);
Subroutine stop_impl: not called CC=1 SCAR=6.9
21 }
22  
23 sub status_impl {
24 7 ▶ sleep 2;
Subroutine status_impl: called CC=2 SCAR=6.9
25 7 ▶ if (check_daemon($pidfile)) {
Branch: 1 branch
BranchTrueFalseTotal
if (check_daemon($pidfile)) { } 2 5 7
26 2 return 'running';
27 }
28 else {
29 5 return 'not running';
30 }
31 }
32  
33 sub check_timeout {
34 0 ▶ return 1;
Subroutine check_timeout: not called CC=1 SCAR=6.9
35 }
36  
37 return __PACKAGE__->new;
« lib/Ubic/Result.pm ↑ Summary blib/lib/Ubic/Credentials/OS/Windows.pm »