DBus/Path.pm

filter: Statementstmt 58.3% 14 / 24 Branchbran 0.0% 0 / 6 Conditioncond 12.5% 1 / 8 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 39.2% 20 / 51 SCAR 28.8
CC
7
Cov
39%
login_session_message_bus
42.0
system_message_bus
2.1
BEGIN
1.0
CRAP 17.9
« DBus/Client.pm ↑ Summary DBus/Peer.pm »
1 package Protocol::DBus::Path;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶use Protocol::DBus::Address ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶use constant _DEFAULT_SYSTEM_MESSAGE_BUS => 'unix:path=/var/run/dbus/system_bus_socket';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # NB: If this returns “autolaunch:”, then the system should use
11 # platform-specific methods of locating a running D-Bus session server,
12 # or starting one if a running instance cannot be found.
13 sub login_session_message_bus {
14 0 ▶ my $addr = $ENV{'DBUS_SESSION_BUS_ADDRESS'};
Subroutine login_session_message_bus: not called CC=6 SCAR=37.4
Pod undocumented
15  
16 0 ▶ if (!$addr && ($^O eq 'darwin')) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $addr and $^O eq "darwin") 0 0 0
Condition0%0/3
not $addr and $^O eq "darwin"
!ll&&!rl&&r
000
MC/DC0%0/2
not $addr and $^O eq "darwin"
not $addr $^O eq "darwin"
Truth table0%0/3
not(A) and B
A= not $addrB= $^O eq "darwin"
ABresult
0X0
100
111
17 0 my $path = $ENV{'DBUS_LAUNCHD_SESSION_BUS_SOCKET'};
18  
19 # OK, let’s *really* stretch …
20 0 ▶ $path ||= readpipe( "launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET" );
Condition0%0/3
$path ||= `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
l!l&&r!l&&!r
000
MC/DC0%0/2
$path ||= `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
$path `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
Truth table0%0/3
A ||= B
A= $pathB= `launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET`
ABresult
1X1
011
000
21 0 chomp $path;
22  
23 0 ▶ if ($path) {
Branch: 1 branch
BranchTrueFalseTotal
if ($path) 0 0 0
24 0 chomp $path;
25  
26 0 $addr = "unix:path=$path";
27 }
28 }
29  
30 0 ▶ die "Found no login session message bus address!" if !$addr;
Branch: 1 branch
BranchTrueFalseTotal
unless $addr 0 0 0
31  
32 0 return Protocol::DBus::Address::parse($addr);
33 }
34  
35 sub system_message_bus {
36 1 ▶ return Protocol::DBus::Address::parse( $ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || _DEFAULT_SYSTEM_MESSAGE_BUS() );
Subroutine system_message_bus: called CC=2 SCAR=7.6
Pod undocumented
Condition50%1/2
$ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || 'unix:path=/var/run/dbus/system_bus_socket'
l!l
01
MC/DC0%0/1
$ENV{'DBUS_SYSTEM_BUS_ADDRESS'} || 'unix:path=/var/run/dbus/system_bus_socket'
$ENV{'DBUS_SYSTEM_BUS_ADDRESS'}
Truth table50%1/2
A
A= $ENV{'DBUS_SYSTEM_BUS_ADDRESS'}
Aresult
11
00
37 }
38  
39 5 1;
« DBus/Client.pm ↑ Summary DBus/Peer.pm »