Reading database from /home/pjcj/g/perl/svk/dc/cover_db ------------------------------------------ ------ ------ ------ ------ ------ File stmt bran cond sub total ------------------------------------------ ------ ------ ------ ------ ------ tests/cond_or 93.0 50.0 71.1 66.7 78.2 Total 93.0 50.0 71.1 66.7 78.2 ------------------------------------------ ------ ------ ------ ------ ------ Run: ... Perl version: ... OS: ... Start: ... Finish: ... tests/cond_or line err stmt bran cond sub code 1 #!/usr/bin/perl 2 3 # Copyright 2002-2007, Paul Johnson (pjcj@cpan.org) 4 5 # This software is free. It is licensed under the same terms as Perl itself. 6 7 # The latest version of this software should be available from my homepage: 8 # http://www.pjcj.net 9 10 1 1 use strict; 1 1 11 1 1 use warnings; 1 1 12 13 1 my @x; 14 15 1 my $y = 1; 16 1 my $z = 0; 17 1 $::foo = 17; 18 19 1 for (0 .. 10) 20 { 21 *** 11 50 $y || 22 $x[1]++; 23 24 *** 11 50 33 $y || 25 $x[0]++ || 26 $x[1]++; 27 28 *** 11 50 $x[2]++ 29 unless $z; 30 31 11 for (0 .. 2) 32 { 33 33 $x[3]++; 34 } 35 36 *** 11 50 if ($z) 37 { 38 *** 0 $x[4]++; 39 } 40 else 41 { 42 11 $x[5]++; 43 } 44 45 *** 11 33 my $p = $y || $z; 46 *** 11 33 my $q = $z || $y; 47 11 100 my $r = $_ || "qqq"; 48 11 100 my $s = $_ || []; 49 11 my $t = $y | $z; 50 *** 11 50 my $u = $y || 0; 51 *** 11 50 my $v = $y || undef; 52 *** 11 50 my $w = $z || 0; 53 54 *** 11 50 $p ||= $y; 55 *** 11 50 $p ||= $z; 56 11 100 $x[ 6] ||= $y; 57 *** 11 50 $x[ 7] ||= $z; 58 11 100 $x[ 8] ||= 1; 59 11 100 $x[ 9] ||= {}; 60 11 100 $x[10] ||= \"foo"; 61 11 100 $x[11] ||= \$y; 62 11 100 $x[12] ||= \*STDIO; 63 *** 11 100 0 $x[13] ||= sub { 1 }; *** 0 64 11 100 $x[14] ||= *::foo{SCALAR}; 65 *** 11 50 $x[15] ||= *STDIO{IO}; 66 11 100 $x[16] ||= bless {}, "XXX"; 67 *** 11 50 if ($] >= 5.009) 68 { 69 *** 0 eval '$x[17] //= 0'; 70 } 71 } 72 73 # print join(", ", @x), "\n"; Branches -------- line err % true false branch ----- --- ------ ------ ------ ------ 21 *** 50 0 11 unless $y 24 *** 50 0 11 unless $y or $x[0]++ 28 *** 50 11 0 unless $z 36 *** 50 0 11 if ($z) { } 67 *** 50 0 11 if ($] >= 5.009) Conditions ---------- or 2 conditions line err % l !l expr ----- --- ------ ------ ------ ---- 47 100 10 1 $_ || 'qqq' 48 100 10 1 $_ || [] 50 *** 50 11 0 $y || 0 51 *** 50 11 0 $y || undef 52 *** 50 0 11 $z || 0 54 *** 50 11 0 $p ||= $y 55 *** 50 11 0 $p ||= $z 56 100 10 1 $x[6] ||= $y 57 *** 50 0 11 $x[7] ||= $z 58 100 10 1 $x[8] ||= 1 59 100 10 1 $x[9] ||= {} 60 100 10 1 $x[10] ||= \'foo' 61 100 10 1 $x[11] ||= \$y 62 100 10 1 $x[12] ||= \*STDIO 63 100 10 1 $x[13] ||= sub { 1; } 64 100 10 1 $x[14] ||= *foo{'SCALAR'} 65 *** 50 0 11 $x[15] ||= *STDIO{'IO'} 66 100 10 1 $x[16] ||= bless({}, 'XXX') or 3 conditions line err % l !l&&r !l&&!r expr ----- --- ------ ------ ------ ------ ---- 24 *** 33 11 0 0 $y or $x[0]++ 45 *** 33 11 0 0 $y || $z 46 *** 33 0 11 0 $z || $y Covered Subroutines ------------------- Subroutine Count Location ---------- ----- ---------------- BEGIN 1 tests/cond_or:10 BEGIN 1 tests/cond_or:11 Uncovered Subroutines --------------------- Subroutine Count Location ---------- ----- ---------------- __ANON__ 0 tests/cond_or:63